diff --git a/DESCRIPTION b/DESCRIPTION index 146fcb3..ff833a1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -58,4 +58,4 @@ Config/testthat/edition: 3 Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.3 +Config/roxygen2/version: 8.0.0 diff --git a/R/add_resource.R b/R/add_resource.R index 617dcb1..dc4466f 100644 --- a/R/add_resource.R +++ b/R/add_resource.R @@ -37,7 +37,7 @@ #' The following properties are automatically set and can't be provided with #' `...`: `name`, `data`, `path`, `schema`, `profile`, `format`, `mediatype`, #' `encoding` and `dialect`. -#' @return `package` with one additional resource. +#' @returns `package` with one additional resource. #' @family edit functions #' @export #' @examples diff --git a/R/check_data.R b/R/check_data.R index 12b9bdd..ccec247 100644 --- a/R/check_data.R +++ b/R/check_data.R @@ -3,7 +3,7 @@ #' Check if an object is a non-empty data frame. #' #' @param data A data frame. -#' @return `data` invisibly or an error. +#' @returns `data` invisibly or an error. #' @family check functions #' @noRd check_data <- function(data) { diff --git a/R/check_package.R b/R/check_package.R index 4391064..41255d1 100644 --- a/R/check_package.R +++ b/R/check_package.R @@ -3,7 +3,7 @@ #' Check if an object is a Data Package object with the required properties. #' #' @inheritParams read_resource -#' @return `package` invisibly or an error. +#' @returns `package` invisibly or an error. #' @family check functions #' @export #' @examples diff --git a/R/check_path.R b/R/check_path.R index 37a2652..8ee21cb 100644 --- a/R/check_path.R +++ b/R/check_path.R @@ -10,7 +10,7 @@ #' @param directory Directory to prepend to path. #' @param safe Require `path` to be safe, i.e. no absolute or relative parent #' paths. -#' @return Absolute path or URL or an error. +#' @returns Absolute path or URL or an error. #' @family check functions #' @noRd check_path <- function(path, directory = NULL, safe = FALSE) { diff --git a/R/check_schema.R b/R/check_schema.R index 9bd2049..f01570a 100644 --- a/R/check_schema.R +++ b/R/check_schema.R @@ -5,7 +5,7 @@ #' #' @param schema List describing a Table Schema. #' @param data A data frame against which the Table Schema must be compared. -#' @return `schema` invisibly or an error. +#' @returns `schema` invisibly or an error. #' @family check functions #' @noRd check_schema <- function(schema, data = NULL) { diff --git a/R/col_types.R b/R/col_types.R index eef9c14..5d95b75 100644 --- a/R/col_types.R +++ b/R/col_types.R @@ -3,7 +3,7 @@ #' Creates a [readr::cols()] for all fields in a Table Schema. #' #' @inheritParams check_schema -#' @return A [readr::cols()] object. +#' @returns A [readr::cols()] object. #' @family parse functions #' @noRd cols <- function(schema) { @@ -33,7 +33,7 @@ cols <- function(schema) { #' Creates a column specification for a specific field in a Table Schema. #' #' @param field Field in a Table schema. -#' @return A readr collector. +#' @returns A readr collector. #' @family parse functions #' @noRd field_to_col <- function(field) { diff --git a/R/collectors.R b/R/collectors.R index a9afd3c..9df782e 100644 --- a/R/collectors.R +++ b/R/collectors.R @@ -1,7 +1,7 @@ #' Parse a string field #' #' @inheritParams col_number -#' @return A readr collector. +#' @returns A readr collector. #' @family parse functions #' @noRd col_string <- function(enum) { @@ -17,7 +17,7 @@ col_string <- function(enum) { #' @param enum A field's `constraints.enum`. #' @param group_char A field's `groupChar`. #' @param bare_number A field's `bareNumber`. -#' @return A readr collector. +#' @returns A readr collector. #' @family parse functions #' @noRd col_number <- function(enum, group_char, bare_number) { @@ -35,7 +35,7 @@ col_number <- function(enum, group_char, bare_number) { #' Parse an integer field #' #' @inheritParams col_number -#' @return A readr collector. +#' @returns A readr collector. #' @family parse functions #' @noRd col_integer <- function(enum, bare_number) { @@ -51,7 +51,7 @@ col_integer <- function(enum, bare_number) { #' Parse a date field #' #' @inheritParams col_datetime -#' @return A readr collector. +#' @returns A readr collector. #' @family parse functions #' @noRd col_date <- function(format) { @@ -69,7 +69,7 @@ col_date <- function(format) { #' Parse a time field #' #' @inheritParams col_datetime -#' @return A readr collector. +#' @returns A readr collector. #' @family parse functions #' @noRd col_time <- function(format) { @@ -87,7 +87,7 @@ col_time <- function(format) { #' Parse a datetime field #' #' @param format A field's `format`. -#' @return A readr collector. +#' @returns A readr collector. #' @family parse functions #' @noRd col_datetime <- function(format) { diff --git a/R/create_package.R b/R/create_package.R index 92d35ce..1045dc8 100644 --- a/R/create_package.R +++ b/R/create_package.R @@ -17,7 +17,7 @@ #' #' @param descriptor List to be made into a Data Package object. #' If undefined, an empty Data Package will be created from scratch. -#' @return A Data Package object. +#' @returns A Data Package object. #' @family create functions #' @export #' @examples diff --git a/R/create_schema.R b/R/create_schema.R index 1a6ea33..d48acdb 100644 --- a/R/create_schema.R +++ b/R/create_schema.R @@ -7,7 +7,7 @@ #' Data Package standard. #' #' @param data A data frame. -#' @return List describing a Table Schema. +#' @returns List describing a Table Schema. #' @family create functions #' @export #' @examples diff --git a/R/example_package.R b/R/example_package.R index fe257be..c77d9d7 100644 --- a/R/example_package.R +++ b/R/example_package.R @@ -15,7 +15,7 @@ #' - `2.0`: specified as a [Data Package v2](https://datapackage.org/). #' #' @param version Data Package standard version. -#' @return A Data Package object, see [create_package()]. +#' @returns A Data Package object, see [create_package()]. #' @family sample data #' @export #' @examples diff --git a/R/locale.R b/R/locale.R index 9f8cc1b..0725645 100644 --- a/R/locale.R +++ b/R/locale.R @@ -4,7 +4,7 @@ #' `decimal_mark`, `grouping_mark` and `encoding`. #' #' @inheritParams read_resource -#' @return A [readr::locale()] object. +#' @returns A [readr::locale()] object. #' @family parse functions #' @noRd locale <- function(package, resource_name) { diff --git a/R/print.datapackage.R b/R/print.datapackage.R index 4820991..b4cbd19 100644 --- a/R/print.datapackage.R +++ b/R/print.datapackage.R @@ -6,7 +6,7 @@ #' @param x Data Package object, as returned by [read_package()] or #' [create_package()]. #' @param ... Further arguments, they are ignored by this function. -#' @return [print()] with a summary of the Data Package object. +#' @returns [print()] with a summary of the Data Package object. #' @family print functions #' @export #' @examples diff --git a/R/read_from_path.R b/R/read_from_path.R index 6ffe0a4..f2dda21 100644 --- a/R/read_from_path.R +++ b/R/read_from_path.R @@ -1,7 +1,7 @@ #' Read data from the path of a Data Resource #' #' @inheritParams read_resource -#' @return A [tibble::tibble()]. +#' @returns A [tibble::tibble()]. #' @family read functions #' @noRd read_from_path <- function(package, resource_name, col_select) { diff --git a/R/read_package.R b/R/read_package.R index 7bf934c..98936a7 100644 --- a/R/read_package.R +++ b/R/read_package.R @@ -8,7 +8,7 @@ #' Data Package standard. #' #' @param file Path or URL to a `datapackage.json` file. -#' @return A Data Package object, see [create_package()]. +#' @returns A Data Package object, see [create_package()]. #' @family read functions #' @export #' @examples diff --git a/R/read_resource.R b/R/read_resource.R index 4d4291e..05364fd 100644 --- a/R/read_resource.R +++ b/R/read_resource.R @@ -19,7 +19,7 @@ #' @param col_select Character vector of the columns to include in the result, #' in the order provided. #' Selecting columns can improve read speed. -#' @return A [tibble::tibble()] with the Data Resource's tabular data. +#' @returns A [tibble::tibble()] with the Data Resource's tabular data. #' If there are parsing problems, a warning will alert you. #' You can retrieve the full details by calling [problems()] on your data #' frame. diff --git a/R/remove_resource.R b/R/remove_resource.R index ef18a93..6496f90 100644 --- a/R/remove_resource.R +++ b/R/remove_resource.R @@ -4,7 +4,7 @@ #' described `resources`. #' #' @inheritParams read_resource -#' @return `package` with one fewer resource. +#' @returns `package` with one fewer resource. #' @family edit functions #' @export #' @examples diff --git a/R/resource.R b/R/resource.R index 3c4244c..91964a8 100644 --- a/R/resource.R +++ b/R/resource.R @@ -4,7 +4,7 @@ #' described `resources`. #' #' @inheritParams read_resource -#' @return List describing a Data Resource, with new attribute `data_location` +#' @returns List describing a Data Resource, with new attribute `data_location` #' to indicate how the data are attached. #' If present, `path` will be updated to contain the full path(s). #' @family accessor functions diff --git a/R/resource_names.R b/R/resource_names.R index 15fbfea..fecac41 100644 --- a/R/resource_names.R +++ b/R/resource_names.R @@ -3,7 +3,7 @@ #' Lists the names of the Data Resources included in a Data Package. #' #' @inheritParams read_resource -#' @return Character vector with the Data Resource names. +#' @returns Character vector with the Data Resource names. #' @family accessor functions #' @export #' @examples diff --git a/R/schema.R b/R/schema.R index 9252057..05d59b2 100644 --- a/R/schema.R +++ b/R/schema.R @@ -9,7 +9,7 @@ #' See `vignette("table-schema")` to learn more about Table Schema. #' #' @inheritParams read_resource -#' @return List describing a Table Schema. +#' @returns List describing a Table Schema. #' @family accessor functions #' @export #' @examples diff --git a/R/utils.R b/R/utils.R index 9964ebc..2d4a05d 100644 --- a/R/utils.R +++ b/R/utils.R @@ -3,7 +3,7 @@ #' Get unique vector values sorted by how often they occur #' #' @param x Vector, e.g. `c("a", "b", "b", "b", "c", "a")`. -#' @return Vector with unique values sorted by most to least occurring, +#' @returns Vector with unique values sorted by most to least occurring, #' e.g. `c("b", "a", "c")`. #' @family helper functions #' @noRd @@ -27,7 +27,7 @@ unique_sorted <- function(x) { #' @param x List or vector. #' @param fun Function returning `TRUE` for elements that should be removed. #' @param recursive Whether list should be cleaned recursively. -#' @return Cleaned list. +#' @returns Cleaned list. #' @family helper functions #' @noRd clean_list <- function(x, fun = is.null, recursive = FALSE) { @@ -46,7 +46,7 @@ clean_list <- function(x, fun = is.null, recursive = FALSE) { #' Check if path is URL #' #' @param path Path. -#' @return `TRUE` if `path` is a http(s) or (s)ftp URL, otherwise `FALSE`. +#' @returns `TRUE` if `path` is a http(s) or (s)ftp URL, otherwise `FALSE`. #' @family helper functions #' @noRd is_url <- function(path) { @@ -58,7 +58,7 @@ is_url <- function(path) { #' Returns descriptor `x` as is, or attempts to read JSON/YAML from path or URL. #' #' @inheritParams check_path -#' @return `x` (unchanged) or loaded JSON/YAML at path or URL. +#' @returns `x` (unchanged) or loaded JSON/YAML at path or URL. #' @family helper functions #' @noRd read_descriptor <- function(x, directory = NULL, safe = FALSE) { @@ -82,7 +82,7 @@ read_descriptor <- function(x, directory = NULL, safe = FALSE) { #' Replicates the base function [...names()] available in R >= 4.0.0. #' #' @param ... objects, possibly named -#' @return A character vector of the names of the ... arguments +#' @returns A character vector of the names of the ... arguments #' @noRd get_dot_names <- function(...) { # Get all the names from ... diff --git a/R/write_package.R b/R/write_package.R index cfcc2ba..39aaf18 100644 --- a/R/write_package.R +++ b/R/write_package.R @@ -18,7 +18,7 @@ #' @param directory Path to local directory to write files to. #' @param compress If `TRUE`, data of added resources will be gzip compressed #' before being written to disk (e.g. `deployments.csv.gz`). -#' @return `package` invisibly, as written to file. +#' @returns `package` invisibly, as written to file. #' @family write functions #' @export #' @examples diff --git a/R/write_resource.R b/R/write_resource.R index 2036f70..9d1a049 100644 --- a/R/write_resource.R +++ b/R/write_resource.R @@ -4,7 +4,7 @@ #' #' @inheritParams read_resource #' @inheritParams write_package -#' @return Updated list describing a Data Resource, ready to be included in a +#' @returns Updated list describing a Data Resource, ready to be included in a #' `datapackage.json`. #' @family write functions #' @noRd diff --git a/man/add_resource.Rd b/man/add_resource.Rd index 2107a7d..e704638 100644 --- a/man/add_resource.Rd +++ b/man/add_resource.Rd @@ -113,7 +113,7 @@ package <- add_resource( resource_names(package) } \seealso{ -Other edit functions: -\code{\link{remove_resource}()} +Other edit functions: +\code{\link[=remove_resource]{remove_resource()}} } \concept{edit functions} diff --git a/man/create_package.Rd b/man/create_package.Rd index 1b49a50..b572cea 100644 --- a/man/create_package.Rd +++ b/man/create_package.Rd @@ -42,7 +42,7 @@ package str(package) } \seealso{ -Other create functions: -\code{\link{create_schema}()} +Other create functions: +\code{\link[=create_schema]{create_schema()}} } \concept{create functions} diff --git a/man/create_schema.Rd b/man/create_schema.Rd index e5fd30e..d0cfcda 100644 --- a/man/create_schema.Rd +++ b/man/create_schema.Rd @@ -36,7 +36,7 @@ schema <- create_schema(df) str(schema) } \seealso{ -Other create functions: -\code{\link{create_package}()} +Other create functions: +\code{\link[=create_package]{create_package()}} } \concept{create functions} diff --git a/man/frictionless-package.Rd b/man/frictionless-package.Rd index fb7136f..8174711 100644 --- a/man/frictionless-package.Rd +++ b/man/frictionless-package.Rd @@ -18,18 +18,19 @@ Useful links: } \author{ -\strong{Maintainer}: Peter Desmet \email{peter.desmet@inbo.be} (\href{https://orcid.org/0000-0002-8442-8025}{ORCID}) (Research Institute for Nature and Forest (INBO)) +\strong{Maintainer}: Peter Desmet \email{peter.desmet@inbo.be} (\href{https://orcid.org/0000-0002-8442-8025}{ORCID}) (affiliation: Research Institute for Nature and Forest (INBO)) Authors: \itemize{ - \item Damiano Oldoni \email{damiano.oldoni@inbo.be} (\href{https://orcid.org/0000-0003-3445-7562}{ORCID}) (Research Institute for Nature and Forest (INBO)) - \item Pieter Huybrechts \email{pieter.huybrechts@inbo.be} (\href{https://orcid.org/0000-0002-6658-6062}{ORCID}) (Research Institute for Nature and Forest (INBO)) - \item Sanne Govaert \email{sanne.govaert@inbo.be} (\href{https://orcid.org/0000-0002-8939-1305}{ORCID}) (Research Institute for Nature and Forest (INBO)) + \item Peter Desmet \email{peter.desmet@inbo.be} (\href{https://orcid.org/0000-0002-8442-8025}{ORCID}) (affiliation: Research Institute for Nature and Forest (INBO)) + \item Damiano Oldoni \email{damiano.oldoni@inbo.be} (\href{https://orcid.org/0000-0003-3445-7562}{ORCID}) (affiliation: Research Institute for Nature and Forest (INBO)) + \item Pieter Huybrechts \email{pieter.huybrechts@inbo.be} (\href{https://orcid.org/0000-0002-6658-6062}{ORCID}) (affiliation: Research Institute for Nature and Forest (INBO)) + \item Sanne Govaert \email{sanne.govaert@inbo.be} (\href{https://orcid.org/0000-0002-8939-1305}{ORCID}) (affiliation: Research Institute for Nature and Forest (INBO)) } Other contributors: \itemize{ - \item Kyle Husmann \email{kdh38@psu.edu} (\href{https://orcid.org/0000-0001-9875-8976}{ORCID}) (Pennsylvania State University) [contributor] + \item Kyle Husmann \email{kdh38@psu.edu} (\href{https://orcid.org/0000-0001-9875-8976}{ORCID}) (affiliation: Pennsylvania State University) [contributor] \item Research Institute for Nature and Forest (INBO) (\href{https://ror.org/00j54wy13}{ROR}) [copyright holder] \item Research Foundation - Flanders (https://lifewatch.be) [funder] \item Beatriz Milz \email{milz.bea@gmail.com} (\href{https://orcid.org/0000-0002-3064-4486}{ORCID}) [reviewer] diff --git a/man/read_package.Rd b/man/read_package.Rd index 098c9a3..2a1f302 100644 --- a/man/read_package.Rd +++ b/man/read_package.Rd @@ -33,7 +33,7 @@ package$name package$created } \seealso{ -Other read functions: -\code{\link{read_resource}()} +Other read functions: +\code{\link[=read_resource]{read_resource()}} } \concept{read functions} diff --git a/man/read_resource.Rd b/man/read_resource.Rd index 5515400..2ee80c3 100644 --- a/man/read_resource.Rd +++ b/man/read_resource.Rd @@ -58,7 +58,7 @@ purrr::map_chr(package$resources[[2]]$schema$fields, "type") read_resource(package, "deployments", col_select = c("latitude", "longitude")) } \seealso{ -Other read functions: -\code{\link{read_package}()} +Other read functions: +\code{\link[=read_package]{read_package()}} } \concept{read functions} diff --git a/man/remove_resource.Rd b/man/remove_resource.Rd index 067ae16..61a020b 100644 --- a/man/remove_resource.Rd +++ b/man/remove_resource.Rd @@ -33,7 +33,7 @@ package <- remove_resource(package, "observations") resource_names(package) } \seealso{ -Other edit functions: -\code{\link{add_resource}()} +Other edit functions: +\code{\link[=add_resource]{add_resource()}} } \concept{edit functions} diff --git a/man/resource_names.Rd b/man/resource_names.Rd index aa68dea..0335aae 100644 --- a/man/resource_names.Rd +++ b/man/resource_names.Rd @@ -24,7 +24,7 @@ package <- example_package() resource_names(package) } \seealso{ -Other accessor functions: -\code{\link{schema}()} +Other accessor functions: +\code{\link[=schema]{schema()}} } \concept{accessor functions} diff --git a/man/schema.Rd b/man/schema.Rd index 44d4d05..90e70bf 100644 --- a/man/schema.Rd +++ b/man/schema.Rd @@ -33,7 +33,7 @@ schema <- schema(package, "observations") str(schema) } \seealso{ -Other accessor functions: -\code{\link{resource_names}()} +Other accessor functions: +\code{\link[=resource_names]{resource_names()}} } \concept{accessor functions} diff --git a/man/write_package.Rd b/man/write_package.Rd index 1e1db59..c5331dc 100644 --- a/man/write_package.Rd +++ b/man/write_package.Rd @@ -31,7 +31,7 @@ location of file(s). \item Resource \code{path} has only URL(s): resource stays as is. \item Resource has inline \code{data} originally: resource stays as is. \item Resource has inline \code{data} as result of adding data with \code{\link[=add_resource]{add_resource()}}: -data are written to a CSV file using \code{\link[readr:write_delim]{readr::write_csv()}}, \code{path} points to +data are written to a CSV file using \code{\link[readr:write_csv]{readr::write_csv()}}, \code{path} points to location of file, \code{data} property is removed. Use \code{compress = TRUE} to gzip those CSV files. }