diff --git a/R/noegletal_get.R b/R/noegletal_get.R index 22c16d6..45d0b9d 100644 --- a/R/noegletal_get.R +++ b/R/noegletal_get.R @@ -123,6 +123,8 @@ noegletal_wrangle <- function(df) { #' @param variable_ids Vector of variable IDs #' @returns Tidy [tibble::tibble()] with requested data #' @export +#' @examples +#' noegletal_get(muni_codes = c(101, 155), years = 2018:2024, variable_ids = c(001)) noegletal_get <- function(muni_codes = ALLOWED_MUNI_CODES, years = ALLOWED_YEARS, variable_ids) { diff --git a/R/noegletal_tidy.R b/R/noegletal_tidy.R index 3b5e678..bc20ba4 100644 --- a/R/noegletal_tidy.R +++ b/R/noegletal_tidy.R @@ -15,6 +15,10 @@ #' and one column for each included variable (nøgletal). #' #' @export +#' @examples +#' \dontrun{ +#' noegletal_tidy(file = 'path/to/csv_file.csv') +#' } noegletal_tidy <- function(file) { if (!file.exists(file)) { diff --git a/R/noegletal_vars.R b/R/noegletal_vars.R index bdef3bf..d54751e 100644 --- a/R/noegletal_vars.R +++ b/R/noegletal_vars.R @@ -23,6 +23,8 @@ #' @returns A [tibble::tibble()] where each row is a variable and the columns are #' 'variable_id', 'variable_name' and 'variable_definition'. #' @export +#' @examples +#' noegletal_vars() noegletal_vars <- function() { source_code <- rvest::read_html("https://www.noegletal.dk/noegletal/ntInfo24A.html", diff --git a/man/noegletalR-package.Rd b/man/noegletalR-package.Rd index 8da2bcf..720a45b 100644 --- a/man/noegletalR-package.Rd +++ b/man/noegletalR-package.Rd @@ -6,7 +6,15 @@ \alias{noegletalR-package} \title{noegletalR: Tidy 'Tibbles' of 'Noegletal'} \description{ -Work with data from 'noegletal.dk' in a 'tidy' manner. Tidy up previously downloaded data or retrieve new data directly from the comfort of R. You can even browse an up-to-date list of available data, including thorough variable descriptions. +Work with data from 'noegletal.dk' in a tidy manner. Tidy up previously downloaded data or retrieve new data directly from the comfort of R. You can also browse an up-to-date list of available data, including thorough variable descriptions. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/FrLars21/noegletalR} + \item Report bugs at \url{https://github.com/FrLars21/noegletalR/issues} +} + } \author{ \strong{Maintainer}: Frederik Larsen \email{frlars21@student.aau.dk} [copyright holder] diff --git a/man/noegletal_get.Rd b/man/noegletal_get.Rd index 400b69f..e8fb3d3 100644 --- a/man/noegletal_get.Rd +++ b/man/noegletal_get.Rd @@ -18,8 +18,11 @@ noegletal_get( \item{variable_ids}{Vector of variable IDs} } \value{ -Tidy tibble with requested data +Tidy \code{\link[tibble:tibble]{tibble::tibble()}} with requested data } \description{ Get data from noegletal.dk } +\examples{ +noegletal_get(muni_codes = c(101, 155), years = 2018:2024, variable_ids = c(001)) +} diff --git a/man/noegletal_tidy.Rd b/man/noegletal_tidy.Rd index 2f9a33d..0b2b9f3 100644 --- a/man/noegletal_tidy.Rd +++ b/man/noegletal_tidy.Rd @@ -23,3 +23,8 @@ As per the noegletal.dk documentation, cells with a dash \code{-} as a value is converted to a 0, while cells with a value of \code{M} or \code{U} is converted to \code{NA}, since these represent missing values. } +\examples{ +\dontrun{ +noegletal_tidy(file = 'path/to/csv_file.csv') +} +} diff --git a/man/noegletal_vars.Rd b/man/noegletal_vars.Rd index 83154bd..6a9c46f 100644 --- a/man/noegletal_vars.Rd +++ b/man/noegletal_vars.Rd @@ -7,7 +7,7 @@ noegletal_vars() } \value{ -A 'tibble' where each row is a variable and the columns are +A \code{\link[tibble:tibble]{tibble::tibble()}} where each row is a variable and the columns are 'variable_id', 'variable_name' and 'variable_definition'. } \description{ @@ -30,3 +30,6 @@ Since the list of variables is retrieved anew on every call, Response caching is on the development roadmap for the \link{noegletalR} package, but is not implemented yet and does come with its own set of challenges. } +\examples{ +noegletal_vars() +}