From e4e34c482d9400c86b5d95e9725627a8ca67fbce Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 26 Oct 2020 17:35:38 -0800 Subject: [PATCH] Resolve CRAN errors Missing scare-quotes around "dataspice" in DESCRIPTION Non-exported functions can't have \dontrun examples Other weird stuff --- DESCRIPTION | 10 +++++----- R/eml_crosswalk.R | 3 +-- R/eml_to_spice.R | 30 ------------------------------ R/jsonld_to_mustache.R | 7 ------- R/prep.R | 3 --- man/crosswalk_variables.Rd | 3 +-- man/es_access.Rd | 9 --------- man/es_attributes.Rd | 7 ------- man/es_biblio.Rd | 7 ------- man/es_creators.Rd | 7 ------- man/jsonld_to_mustache.Rd | 7 ------- man/prep_attributes.Rd | 3 --- man/validate_file_paths.Rd | 3 --- 13 files changed, 7 insertions(+), 92 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6c34657..cf193a6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,11 +1,11 @@ Package: dataspice Version: 1.0.0 Title: Create Lightweight Schema.org Descriptions of Data -Description: The goal of dataspice is to make it easier for researchers to - create basic, lightweight, and concise metadata files for their datasets. - These basic files can then be used to make useful information available during - analysis, create a helpful dataset "README" webpage, and produce more complex - metadata formats to aid dataset discovery. Metadata fields are based on +Description: The goal of 'dataspice' is to make it easier for researchers to + create basic, lightweight, and concise metadata files for their datasets. + These basic files can then be used to make useful information available during + analysis, create a helpful dataset "README" webpage, and produce more complex + metadata formats to aid dataset discovery. Metadata fields are based on the 'Schema.org' and 'Ecological Metadata Language' standards. Authors@R: c( person("Carl", "Boettiger", role = c("aut"), comment = "https://github.com/cboettig"), diff --git a/R/eml_crosswalk.R b/R/eml_crosswalk.R index cdc23de..2f007b2 100644 --- a/R/eml_crosswalk.R +++ b/R/eml_crosswalk.R @@ -247,8 +247,7 @@ crosswalk <- function(doc, term) { #' # Now fill in the attributes data.frame. See `EML::set_attributes`. #' #' # And last, set the attributes on our EML document -#' -#' eml_doc$dataset$dataTable[[1]]$attributeList <- EML::set_attributes(attributes) +#' eml_doc$dataset$dataTable[[1]]$attributeList <- EML::set_attributes(attributes) #' } crosswalk_variables <- function(spice) { if (is.character(spice)) { diff --git a/R/eml_to_spice.R b/R/eml_to_spice.R index e410e4c..55175c0 100644 --- a/R/eml_to_spice.R +++ b/R/eml_to_spice.R @@ -33,15 +33,6 @@ get_access_spice <- function(x){ #' #' @param eml (emld) an EML object #' @param path (character) folder path for saving the table to disk -#' -#' @examples -#' \dontrun{ -#' library(EML) -#' -#' eml_path <- system.file("example-dataset/broodTable_metadata.xml", package = "dataspice") -#' eml <- read_eml(eml_path) -#' es_access(eml) -#' } es_access <- function(eml, path = NULL) { entities <- get_entities(eml) access_entities <- lapply(entities, get_access_spice) @@ -119,13 +110,6 @@ get_attributes_spice <- function(x) { #' #' @import dplyr #' @importFrom readr write_csv -#' -#' @examples -#' \dontrun{ -#' eml_path <- system.file("example-dataset/broodTable_metadata.xml", package = "dataspice") -#' eml <- read_eml(eml_path) -#' es_attributes(eml) -#' } es_attributes <- function(eml, path = NULL) { entities <- get_entities(eml) attrTables <- lapply(entities, get_attributes_spice) @@ -149,13 +133,6 @@ es_attributes <- function(eml, path = NULL) { #' #' @param eml (emld) an EML object #' @param path (character) folder path for saving the table to disk -#' -#' @examples -#' \dontrun{ -#' eml_path <- system.file("example-dataset/broodTable_metadata.xml", package = "dataspice") -#' eml <- read_eml(eml_path) -#' es_biblio(eml) -#' } es_biblio <- function(eml, path = NULL) { biblio_eml <- eml %>% unlist() %>% @@ -208,13 +185,6 @@ es_biblio <- function(eml, path = NULL) { #' @importFrom purrr discard #' @importFrom tibble enframe #' @importFrom tidyr spread -#' -#' @examples -#' \dontrun{ -#' eml_path <- system.file("example-dataset/broodTable_metadata.xml", package = "dataspice") -#' eml <- read_eml(eml_path) -#' es_creators(eml) -#' } es_creators <- function(eml, path = NULL) { people <- get_entities(eml, entities = c("creator", "contact", "associatedParty", "metadataProvider"), diff --git a/R/jsonld_to_mustache.R b/R/jsonld_to_mustache.R index db4c89c..004e270 100644 --- a/R/jsonld_to_mustache.R +++ b/R/jsonld_to_mustache.R @@ -56,13 +56,6 @@ parse_GeoShape_points <- function(points) { #' @param path (character) Path to file on disk to convert #' #' @return (list) Mustache-appropriate list -#' -#' @examples -#' \dontrun{ -#' json_path <- "myjson.json" -#' data <- jsonld_to_mustache(json_path) -#' whisker::whisker_render("{{ keywords }}", data) -#' } jsonld_to_mustache <- function(path) { json <- jsonlite::read_json(path) diff --git a/R/prep.R b/R/prep.R index 514a7f2..bf4a92e 100644 --- a/R/prep.R +++ b/R/prep.R @@ -13,7 +13,6 @@ #' @param ... parameters passed to `list.files()`. For example, use `recursive = TRUE` #' to list files in a folder recursively or use `pattern` to filter files for patterns. #' @return `prep_attributes()` updates the `attributes.csv` and writes to `attributes_path`. -#' `validate_file_paths()` returns a vector of valid file_paths detected from `data_path`. #' @export #' @examples #' \dontrun{ @@ -31,8 +30,6 @@ #' # extract from a folder using folder path #' data_path <- system.file("example-dataset", package = "dataspice") #' prep_attributes(data_path) -#' # get vector of valid (existing) file paths -#' validate_file_paths(data_path) #' } prep_attributes <- function(data_path = "data", attributes_path = "data/metadata/attributes.csv", diff --git a/man/crosswalk_variables.Rd b/man/crosswalk_variables.Rd index 425340a..d2a4663 100644 --- a/man/crosswalk_variables.Rd +++ b/man/crosswalk_variables.Rd @@ -30,7 +30,6 @@ attributes <- crosswalk_variables(spice) # Now fill in the attributes data.frame. See `EML::set_attributes`. # And last, set the attributes on our EML document - - eml_doc$dataset$dataTable[[1]]$attributeList <- EML::set_attributes(attributes) +eml_doc$dataset$dataTable[[1]]$attributeList <- EML::set_attributes(attributes) } } diff --git a/man/es_access.Rd b/man/es_access.Rd index 5b7fe44..3a587cb 100644 --- a/man/es_access.Rd +++ b/man/es_access.Rd @@ -14,12 +14,3 @@ es_access(eml, path = NULL) \description{ Return EML access in the dataspice access.csv format. } -\examples{ -\dontrun{ -library(EML) - -eml_path <- system.file("example-dataset/broodTable_metadata.xml", package = "dataspice") -eml <- read_eml(eml_path) -es_access(eml) -} -} diff --git a/man/es_attributes.Rd b/man/es_attributes.Rd index 0af395c..dd30fcd 100644 --- a/man/es_attributes.Rd +++ b/man/es_attributes.Rd @@ -14,10 +14,3 @@ es_attributes(eml, path = NULL) \description{ Return EML attributes in the dataspice attributes.csv format. } -\examples{ -\dontrun{ -eml_path <- system.file("example-dataset/broodTable_metadata.xml", package = "dataspice") -eml <- read_eml(eml_path) -es_attributes(eml) -} -} diff --git a/man/es_biblio.Rd b/man/es_biblio.Rd index 6523a27..98a53d4 100644 --- a/man/es_biblio.Rd +++ b/man/es_biblio.Rd @@ -14,10 +14,3 @@ es_biblio(eml, path = NULL) \description{ Return EML biblio in the dataspice biblio.csv format. } -\examples{ -\dontrun{ -eml_path <- system.file("example-dataset/broodTable_metadata.xml", package = "dataspice") -eml <- read_eml(eml_path) -es_biblio(eml) -} -} diff --git a/man/es_creators.Rd b/man/es_creators.Rd index dd532f8..e309a2b 100644 --- a/man/es_creators.Rd +++ b/man/es_creators.Rd @@ -14,10 +14,3 @@ es_creators(eml, path = NULL) \description{ Return EML creators in the dataspice creators.csv format. } -\examples{ -\dontrun{ -eml_path <- system.file("example-dataset/broodTable_metadata.xml", package = "dataspice") -eml <- read_eml(eml_path) -es_creators(eml) -} -} diff --git a/man/jsonld_to_mustache.Rd b/man/jsonld_to_mustache.Rd index e297b67..34432eb 100644 --- a/man/jsonld_to_mustache.Rd +++ b/man/jsonld_to_mustache.Rd @@ -15,10 +15,3 @@ jsonld_to_mustache(path) \description{ Convert JSONLD to a list suitable for Mustache templating } -\examples{ -\dontrun{ -json_path <- "myjson.json" -data <- jsonld_to_mustache(json_path) -whisker::whisker_render("{{ keywords }}", data) -} -} diff --git a/man/prep_attributes.Rd b/man/prep_attributes.Rd index d38f724..ec42dd4 100644 --- a/man/prep_attributes.Rd +++ b/man/prep_attributes.Rd @@ -26,7 +26,6 @@ to list files in a folder recursively or use \code{pattern} to filter files for } \value{ \code{prep_attributes()} updates the \code{attributes.csv} and writes to \code{attributes_path}. -\code{validate_file_paths()} returns a vector of valid file_paths detected from \code{data_path}. } \description{ Extract \code{variableNames} from data file(s) and add them to \code{attributes.csv}. The @@ -49,7 +48,5 @@ prep_attributes(data_path, pattern = "StockInfo") # extract from a folder using folder path data_path <- system.file("example-dataset", package = "dataspice") prep_attributes(data_path) -# get vector of valid (existing) file paths -validate_file_paths(data_path) } } diff --git a/man/validate_file_paths.Rd b/man/validate_file_paths.Rd index 7edcb40..00af747 100644 --- a/man/validate_file_paths.Rd +++ b/man/validate_file_paths.Rd @@ -20,7 +20,6 @@ to list files in a folder recursively or use \code{pattern} to filter files for } \value{ \code{prep_attributes()} updates the \code{attributes.csv} and writes to \code{attributes_path}. -\code{validate_file_paths()} returns a vector of valid file_paths detected from \code{data_path}. } \description{ Extract \code{variableNames} from data file(s) and add them to \code{attributes.csv}. The @@ -43,7 +42,5 @@ prep_attributes(data_path, pattern = "StockInfo") # extract from a folder using folder path data_path <- system.file("example-dataset", package = "dataspice") prep_attributes(data_path) -# get vector of valid (existing) file paths -validate_file_paths(data_path) } }