From f37ade93717bb5a1aa01aaa4f3ffda9674780a97 Mon Sep 17 00:00:00 2001 From: Peter Desmet <600993+peterdesmet@users.noreply.github.com> Date: Fri, 26 Jun 2026 10:15:55 +0200 Subject: [PATCH 1/2] Use Roxygen tag `@returns` --- R/add_resource.R | 2 +- R/check_data.R | 2 +- R/check_package.R | 2 +- R/check_path.R | 2 +- R/check_schema.R | 2 +- R/col_types.R | 4 ++-- R/collectors.R | 12 ++++++------ R/create_package.R | 2 +- R/create_schema.R | 2 +- R/example_package.R | 2 +- R/locale.R | 2 +- R/print.datapackage.R | 2 +- R/read_from_path.R | 2 +- R/read_package.R | 2 +- R/read_resource.R | 2 +- R/remove_resource.R | 2 +- R/resource.R | 2 +- R/resource_names.R | 2 +- R/schema.R | 2 +- R/utils.R | 10 +++++----- R/write_package.R | 2 +- R/write_resource.R | 2 +- 22 files changed, 32 insertions(+), 32 deletions(-) diff --git a/R/add_resource.R b/R/add_resource.R index 617dcb1c..dc4466f3 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 12b9bddc..ccec247c 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 43910648..41255d11 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 37a26526..8ee21cb5 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 9bd2049f..f01570a6 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 eef9c14d..5d95b757 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 a9afd3cd..9df782ee 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 92d35ce1..1045dc8f 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 1a6ea33d..d48acdb1 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 fe257be7..c77d9d7f 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 9f8cc1bb..07256457 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 4820991f..b4cbd19f 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 6ffe0a45..f2dda21d 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 7bf934c8..98936a7b 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 4d4291e5..05364fd2 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 ef18a932..6496f90d 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 3c4244ca..91964a81 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 15fbfea1..fecac41f 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 9252057e..05d59b20 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 9964ebce..2d4a05df 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 cfcc2ba3..39aaf18e 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 2036f706..9d1a0499 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 From 8ee22c969695a1958eea177cc050869fdae30a23 Mon Sep 17 00:00:00 2001 From: Peter Desmet <600993+peterdesmet@users.noreply.github.com> Date: Fri, 26 Jun 2026 10:17:06 +0200 Subject: [PATCH 2/2] Use Roxygen 8.0.0 --- DESCRIPTION | 2 +- man/add_resource.Rd | 4 ++-- man/create_package.Rd | 4 ++-- man/create_schema.Rd | 4 ++-- man/frictionless-package.Rd | 11 ++++++----- man/read_package.Rd | 4 ++-- man/read_resource.Rd | 4 ++-- man/remove_resource.Rd | 4 ++-- man/resource_names.Rd | 4 ++-- man/schema.Rd | 4 ++-- man/write_package.Rd | 2 +- 11 files changed, 24 insertions(+), 23 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 146fcb3e..ff833a10 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/man/add_resource.Rd b/man/add_resource.Rd index 2107a7da..e704638d 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 1b49a50f..b572cea3 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 e5fd30ee..d0cfcda0 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 fb7136f5..81747111 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 098c9a3e..2a1f302e 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 55154003..2ee80c3f 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 067ae16b..61a020b8 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 aa68deac..0335aae9 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 44d4d059..90e70bf8 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 1e1db593..c5331dc7 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. }