Skip to content

Commit

Permalink
Sytle: Update after CRAN comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ybkamaleri committed Jan 23, 2024
1 parent cc11ed3 commit 9e485d3
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 42 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Description: Regional granularity levels in Norway which are depicted by differe
Identifying when codes have changed and how many changes have taken place
can be troublesome. This package will help to identify these changes and when the changes
have taken place. One of the limitation of this package is that it is heavily depending
on the codes available from SSB website <https://data.ssb.no/api/klass/v1/api-guide.html>.
on the codes available from Statistics Norway (SSB) website <https://data.ssb.no/api/klass/v1/api-guide.html>.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Expand All @@ -27,7 +27,6 @@ Imports:
data.table (>= 1.14.0),
odbc,
DBI,
magrittr,
RSQLite,
writexl,
httr2,
Expand Down
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Generated by roxygen2: do not edit by hand

export("%>%")
export(cast_geo)
export(dataApi)
export(geo_save)
Expand All @@ -12,4 +11,3 @@ export(track_change)
export(track_merge)
export(track_split)
import(data.table)
importFrom(magrittr,"%>%")
5 changes: 1 addition & 4 deletions R/cast-geo.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' @export

cast_geo <- function(year = NULL, names = TRUE) {
cat("Start casting geo codes from API ..")
message("Start casting geo codes from API ...")
level <- sourceCode <- kommune <- fylke <- grunnkrets <- bydel <- NULL

if (is.null(year)) {
Expand All @@ -31,7 +31,6 @@ cast_geo <- function(year = NULL, names = TRUE) {
for (i in seq_along(geos)) {
DT[[geos[i]]] <- norgeo::get_code(geos[i], from = year)
DT[[geos[i]]][, level := geos[i]]
cat("..")
}

dt <- data.table::rbindlist(DT)
Expand All @@ -48,8 +47,6 @@ cast_geo <- function(year = NULL, names = TRUE) {
kom_fylke = c("fylke", "kommune")
)

cat("..\n")

for (i in seq_along(COR)) {
COR[[i]] <- find_correspond(COR[[i]][1], COR[[i]][2], from = year)

Expand Down
1 change: 0 additions & 1 deletion R/get-change.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ get_change <- function(type = c(
listDT[[i]] <- chgDT
}

cat("\n")
DT <- data.table::rbindlist(listDT, fill = TRUE, use.names = TRUE)

## need to create empty data.table when it's empty data from API
Expand Down
1 change: 1 addition & 0 deletions R/save_geo.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#' @param file.type Choose file type as Access, SQLite, Excel or Text
#' @param db.name When choosing a DBMS then specify the database name
#'
#' @return No return value, called for side effects
#' @export

geo_save <- function(tblname = NULL,
Expand Down
2 changes: 1 addition & 1 deletion R/track-change.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' @inheritParams get_code
#' @param fix Default is FALSE. When TRUE then use external codes to fix geo
#' changes manually. The codes is sourced from
#' \href{https://github.com/helseprofil/config/blob/main/geo/}{config} files
#' \href{https://github.com/helseprofil/config/tree/main/geo}{config} files
#' depending on the granularity levels.
#' @return A dataset of class `data.table` consisting all older codes from
#' previous years until the selected year in `to` argument and what these
Expand Down
14 changes: 0 additions & 14 deletions R/utils.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
#' Pipe operator
#'
#' See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details.
#'
#' @name %>%
#' @rdname pipe
#' @keywords internal
#' @export
#' @importFrom magrittr %>%
#' @usage lhs \%>\% rhs
NULL



## write data
## fname is like "~/dir/to/save/filename"
write_tbl <- function(x, fname, format) {
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pkgdown: 2.0.7
pkgdown_sha: ~
articles:
use-api: use-api.html
last_built: 2024-01-22T14:26Z
last_built: 2024-01-23T14:12Z
urls:
reference: https://helseprofil.github.io/norgeo/reference
article: https://helseprofil.github.io/norgeo/articles
Expand Down
6 changes: 6 additions & 0 deletions docs/reference/geo_save.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/track_change.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/search.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions man/geo_save.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions man/pipe.Rd

This file was deleted.

2 changes: 1 addition & 1 deletion man/track_change.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions memo/cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,26 @@ Please add \value to .Rd files regarding exported methods and explain the functi


Please fix and resubmit.

## Version 2.4.2
Please always explain all acronyms in the description text. -> 'SSB'

Please add \value to .Rd files regarding exported methods and explain
the functions results in the documentation. Please write about the
structure of the output (class) and also what the output means. (If a
function does not return a value, please document that too, e.g.
\value{No return value, called for side effects} or similar)
Missing Rd-tags:
geo_save.Rd: \value
pipe.Rd: \value

You write information messages to the console that cannot be easily
suppressed.
It is more R like to generate objects that can be used to extract the
information a user is interested in, and then print() that object.
Instead of print()/cat() rather use message()/warning() or
if(verbose)cat(..) (or maybe stop()) if you really have to write text to
the console. (except for print, summary, interactive functions) ->
R/cast-geo.R

Please fix and resubmit.

0 comments on commit 9e485d3

Please sign in to comment.