From 28da363cb5b7ea266e7449b8ce8c539e031dace8 Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 13:39:12 -0400 Subject: [PATCH 01/77] Adding myself as an author --- DESCRIPTION | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/DESCRIPTION b/DESCRIPTION index a2a8ffc..9213118 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -8,6 +8,11 @@ Authors@R: c( email = "jb160@ucsb.edu", comment = c(ORCID = "0000-0002-7751-6238"), role = c("cre", "aut")), + person("Nicholas", "Lyon", + email = "lyon@nceas.ucsb.edu", + comment = c(ORCID = "0000-0003-3905-1078", + "https://njlyon0.github.io/"), + role = "aut"), person("Irene", "Steves", comment = c(ORCID = "0000-0002-5511-9717", "https://github.com/isteves"), From 6808dca15b8d9ca52b0d26cad2830292bbdfc4e4 Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 13:39:47 -0400 Subject: [PATCH 02/77] Re-documenting to create documentation for new functions and update roxygen number --- DESCRIPTION | 2 +- NAMESPACE | 2 +- man/download_EML_data.Rd | 22 ++++++++++++++++++++++ man/download_ISO_data.Rd | 24 ++++++++++++++++++++++++ man/download_d1_data.Rd | 14 ++++---------- 5 files changed, 52 insertions(+), 12 deletions(-) create mode 100644 man/download_EML_data.Rd create mode 100644 man/download_ISO_data.Rd diff --git a/DESCRIPTION b/DESCRIPTION index 9213118..13a4d68 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -65,4 +65,4 @@ Suggests: Encoding: UTF-8 VignetteBuilder: knitr Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.1 +RoxygenNote: 7.2.3 diff --git a/NAMESPACE b/NAMESPACE index f3ef82a..2e2863a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -15,12 +15,12 @@ importFrom(dataone,query) importFrom(emld,as_emld) importFrom(lubridate,ymd_hms) importFrom(purrr,"%||%") -importFrom(rlang,.data) importFrom(stats,setNames) importFrom(stringr,str_detect) importFrom(stringr,str_extract) importFrom(stringr,str_trim) importFrom(tibble,enframe) importFrom(tidyr,pivot_wider) +importFrom(tidyr,spread) importFrom(tools,file_path_sans_ext) importFrom(utils,URLdecode) diff --git a/man/download_EML_data.Rd b/man/download_EML_data.Rd new file mode 100644 index 0000000..0b03ef5 --- /dev/null +++ b/man/download_EML_data.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/download_EML_data.R +\name{download_EML_data} +\alias{download_EML_data} +\title{Download data and metadata from a dataset that uses EML metadata.} +\usage{ +download_EML_data(meta_obj, meta_id, data_id, metadata_nodes, path) +} +\arguments{ +\item{meta_obj}{(character) A metadata object produced by download_d1_data. This is a different format than the metadata object required for the analogous ISO function} + +\item{meta_id}{(character) A metadata identifier produced by download_d1_data} + +\item{data_id}{(character) A data identifier produced by download_d1_data} + +\item{metadata_nodes}{(character) The member nodes where this metadata is stored, produced by download_d1_data} + +\item{path}{(character) Path to a directory to download data to.} +} +\description{ +This is an internal function called by the download_d1_data.R function. Not to be exported +} diff --git a/man/download_ISO_data.Rd b/man/download_ISO_data.Rd new file mode 100644 index 0000000..9001732 --- /dev/null +++ b/man/download_ISO_data.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/download_ISO_data.R +\name{download_ISO_data} +\alias{download_ISO_data} +\title{Download data and metadata from a dataset that uses ISO metadata.} +\usage{ +download_ISO_data(meta_raw, meta_obj, meta_id, data_id, metadata_nodes, path) +} +\arguments{ +\item{meta_raw}{(character) A raw metadata object produced by download_d1_data} + +\item{meta_obj}{(character) A metadata object produced by download_d1_data} + +\item{meta_id}{(character) A metadata identifier produced by download_d1_data} + +\item{data_id}{(character) A data identifier produced by download_d1_data} + +\item{metadata_nodes}{(character) The member nodes where this metadata is stored, produced by download_d1_data} + +\item{path}{(character) Path to a directory to download data to.} +} +\description{ +This is an internal function called by the download_d1_data.R function. Not to be exported +} diff --git a/man/download_d1_data.Rd b/man/download_d1_data.Rd index 53e4122..5810246 100644 --- a/man/download_d1_data.Rd +++ b/man/download_d1_data.Rd @@ -4,14 +4,12 @@ \alias{download_d1_data} \title{Download data and metadata from DataONE} \usage{ -download_d1_data(data_url, path, dir_name = NULL) +download_d1_data(data_url, path) } \arguments{ \item{data_url}{(character) An identifier or URL for a DataONE object to download.} \item{path}{(character) Path to a directory to download data to.} - -\item{dir_name}{(character) (Optional) Desired name for the folder containing the downloaded data. Defaults to the data file name.} } \value{ (character) Path where data is downloaded to. @@ -21,16 +19,12 @@ Downloads a data object from DataONE along with metadata. } \examples{ \dontrun{ -soi_moist_path <- download_d1_data( - data_url = "urn:uuid:a2834e3e-f453-4c2b-8343-99477662b570", - path = tempdir()) +download_d1_data("urn:uuid:a2834e3e-f453-4c2b-8343-99477662b570", path = "./Data") download_d1_data( - data_url = "https://cn.dataone.org/cn/v2/resolve/urn:uuid:a2834e3e-f453-4c2b-8343-99477662b570", - path = tempdir(), - dir_name = "test" + "https://cn.dataone.org/cn/v2/resolve/urn:uuid:a2834e3e-f453-4c2b-8343-99477662b570", + path = "." ) } - } \seealso{ \code{\link[=read_d1_files]{read_d1_files()}} \code{\link[=download_d1_data_pkg]{download_d1_data_pkg()}} From 827dfe02ae98a9658e91a7a609fefe98e06378d5 Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 13:46:59 -0400 Subject: [PATCH 03/77] Fixed file paths, silenced a title mistmatch issue, and renamed chunks with duplicate chunk names --- vignettes/dataset-single-DataOne.Rmd | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/vignettes/dataset-single-DataOne.Rmd b/vignettes/dataset-single-DataOne.Rmd index 599d72d..381873f 100644 --- a/vignettes/dataset-single-DataOne.Rmd +++ b/vignettes/dataset-single-DataOne.Rmd @@ -14,6 +14,9 @@ knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) + +# Ignore difference in YAML title versus `\VignetteIndexEntry{}` +options(rmarkdown.html_vignette.check_title = FALSE) ``` ## Summary @@ -92,7 +95,7 @@ At this point, you should have the data and the metadata downloaded inside your ```{r, out.width="90%", echo=FALSE, fig.align="center", fig.cap="Local file structure of a dataset downloaded by metajam"} -knitr::include_graphics("../inst/images/metajam_v1_folder.png") +knitr::include_graphics("../man/figures/metajam_v1_folder.png") ``` @@ -115,13 +118,13 @@ For the second example, we are using Marine bird survey observation and density ## Libraries and constants -```{r libraries, warning=FALSE} +```{r libraries-2, warning=FALSE} # devtools::install_github("NCEAS/metajam") library(metajam) ``` -```{r constants} +```{r constants-2} # Directory to save the data set path_folder <- "Data_alaska" @@ -133,7 +136,7 @@ data_url <- "https://cn.dataone.org/cn/v2/resolve/4139539e-94e7-49cc-9c7a-5f879e ## Download the dataset -```{r download, eval=FALSE} +```{r download-2, eval=FALSE} # Create the local directory to download the datasets dir.create(path_folder, showWarnings = FALSE) @@ -155,13 +158,13 @@ At this point, you should have the data and the metadata downloaded inside your ```{r, out.width="90%", echo=FALSE, fig.align="center", fig.cap="Local file structure of a dataset downloaded by metajam"} -knitr::include_graphics("../inst/images/metajam_v1_folder.png") +knitr::include_graphics("../man/figures/metajam_v1_folder.png") ``` ## Read the data and metadata in your R environment -```{r read_data, eval=FALSE} +```{r read_data-2, eval=FALSE} # Read all the datasets and their associated metadata in as a named list coweeta_diatom <- metajam::read_d1_files(data_folder) @@ -173,5 +176,5 @@ You have now loaded in your R environment one named list object that contains th ```{r, out.width="90%", echo=FALSE, fig.align="center", fig.cap="Structure of the named list object containing tabular metadata and data as loaded by metajam"} -knitr::include_graphics("../inst/images/metajam_v1_named_list.png") +knitr::include_graphics("../man/figures/metajam_v1_named_list.png") ``` From 1b95e040824d0271f403158d4b01f4d9d5364852 Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 13:54:37 -0400 Subject: [PATCH 04/77] Moving exploratory stuff to a dedicated subfolder that has its own README and is excluded from the package build --- .Rbuildignore | 1 + dev/README.md | 3 +++ reprex_iso_xml_to_eml_GMD.R => dev/reprex_iso_xml_to_eml_GMD.R | 0 trying_loop_for_all_mns.Rmd => dev/trying_loop_for_all_mns.Rmd | 0 4 files changed, 4 insertions(+) create mode 100644 dev/README.md rename reprex_iso_xml_to_eml_GMD.R => dev/reprex_iso_xml_to_eml_GMD.R (100%) rename trying_loop_for_all_mns.Rmd => dev/trying_loop_for_all_mns.Rmd (100%) diff --git a/.Rbuildignore b/.Rbuildignore index dd63e3b..090feea 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,6 +1,7 @@ ^Meta$ ^doc$ ^docs$ +^dev/$ ^_pkgdown\.yml$ ^.*\.Rproj$ ^\.Rproj\.user$ diff --git a/dev/README.md b/dev/README.md new file mode 100644 index 0000000..4e8e9a7 --- /dev/null +++ b/dev/README.md @@ -0,0 +1,3 @@ +# Development Area for `metajam` + +Exploratory / testing scripts live here. Nothing in this folder is included in the package build. diff --git a/reprex_iso_xml_to_eml_GMD.R b/dev/reprex_iso_xml_to_eml_GMD.R similarity index 100% rename from reprex_iso_xml_to_eml_GMD.R rename to dev/reprex_iso_xml_to_eml_GMD.R diff --git a/trying_loop_for_all_mns.Rmd b/dev/trying_loop_for_all_mns.Rmd similarity index 100% rename from trying_loop_for_all_mns.Rmd rename to dev/trying_loop_for_all_mns.Rmd From da1791fc2f8816a92f4dc5eccba813c5b2380b90 Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 13:55:56 -0400 Subject: [PATCH 05/77] Alphabetized the dependencies (easier to quickly scan through) --- DESCRIPTION | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 13a4d68..1210ed8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -52,15 +52,15 @@ Imports: lubridate, purrr, readr, + rlang, stats, stringr, tibble, - tidyr, - rlang + tidyr Suggests: - testthat, knitr, rmarkdown, + testthat, udunits2 Encoding: UTF-8 VignetteBuilder: knitr From 9699a02b84202ee6afd8065da0db7fadba33401c Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 13:59:22 -0400 Subject: [PATCH 06/77] Adding XML as an official dependency --- DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1210ed8..8a6744a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -56,7 +56,8 @@ Imports: stats, stringr, tibble, - tidyr + tidyr, + XML Suggests: knitr, rmarkdown, From 1c93ed2dc0affde81762190b17da97aadab8efea Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 14:00:44 -0400 Subject: [PATCH 07/77] Replacing deprecated `tidyr::spread` with `tidyr::pivot_wider` --- R/download_ISO_data.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/download_ISO_data.R b/R/download_ISO_data.R index ba6a689..3fbf1ac 100644 --- a/R/download_ISO_data.R +++ b/R/download_ISO_data.R @@ -70,7 +70,9 @@ ISO_type <- metadata2 %>% filter(name == "doc.children.MD_Metadata.children.meta dplyr::mutate(value = gsub("\n", "", value)) #without this, fields get truncated in Excel - meta_tabular <- metadata %>% tidyr::spread(name, value) + meta_tabular <- tidyr::pivot_wider(data = metadata, + names_from = name, + values_from = value) metadata_url <- metadata_nodes$data$baseURL[[1]] ## Summary metadata from EML (combine with general metadata later) From b61fda8df5b1320de3b35d8bb42f40b744e18759 Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 14:01:59 -0400 Subject: [PATCH 08/77] Removing rlang as a dependency (warning returned that we don't actually use it) --- DESCRIPTION | 1 - 1 file changed, 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 8a6744a..6078eb2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -52,7 +52,6 @@ Imports: lubridate, purrr, readr, - rlang, stats, stringr, tibble, From 748ea841f600fd676f47128e78a9446e73a6a231 Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 14:07:45 -0400 Subject: [PATCH 09/77] Squelching 'visible bindings' NOTE --- R/download_EML_data.R | 2 ++ R/download_ISO_data.R | 3 +++ R/download_d1_data.R | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/R/download_EML_data.R b/R/download_EML_data.R index 1b2e9e1..00a0ba7 100644 --- a/R/download_EML_data.R +++ b/R/download_EML_data.R @@ -19,6 +19,8 @@ download_EML_data <- function(meta_obj, meta_id, data_id, metadata_nodes, path) { + # Silence visible bindings note + data_url <- NULL eml <- tryCatch({emld::as_emld(meta_obj, from = "xml")}, # If eml make EML object error = function(e) {NULL}) diff --git a/R/download_ISO_data.R b/R/download_ISO_data.R index 3fbf1ac..64b9e31 100644 --- a/R/download_ISO_data.R +++ b/R/download_ISO_data.R @@ -22,6 +22,9 @@ download_ISO_data <- function(meta_raw, meta_obj, meta_id, data_id, metadata_nodes, path) { + # Silence visible bindings note + entity_data <- NULL + meta_iso_xml <- XML::xmlTreeParse(meta_raw) eml <- tryCatch({emld::as_emld(meta_obj, from = "xml")}, # If eml make EML object diff --git a/R/download_d1_data.R b/R/download_d1_data.R index 8f1418e..56c4ab7 100644 --- a/R/download_d1_data.R +++ b/R/download_d1_data.R @@ -33,6 +33,10 @@ download_d1_data <- function(data_url, path) { # TODO: add meta_doi to explicitly specify doi + # Silence visible bindings note + entity_data <- eml <- dir_name <- NULL + + stopifnot(is.character(data_url), length(data_url) == 1, nchar(data_url) > 0) stopifnot(is.character(path), length(path) == 1, nchar(path) > 0, dir.exists(path)) From 388df574b107d3e260ba6cdf30251f2018d9a63f Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 14:15:24 -0400 Subject: [PATCH 10/77] Fixing issue with non-unique vignette names --- vignettes/dataset-single-DataOne.Rmd | 2 +- vignettes/dataset-single.Rmd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vignettes/dataset-single-DataOne.Rmd b/vignettes/dataset-single-DataOne.Rmd index 381873f..9c00df3 100644 --- a/vignettes/dataset-single-DataOne.Rmd +++ b/vignettes/dataset-single-DataOne.Rmd @@ -4,7 +4,7 @@ author: "Julien Brun and Kristen Peach, NCEAS" date: "`r Sys.Date()`" output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{"Use Case - Downloading one dataset using metajam"} + %\VignetteIndexEntry{"Use Case - Downloading one dataset from DataOne using metajam"} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- diff --git a/vignettes/dataset-single.Rmd b/vignettes/dataset-single.Rmd index 2f8d546..db333d3 100644 --- a/vignettes/dataset-single.Rmd +++ b/vignettes/dataset-single.Rmd @@ -4,7 +4,7 @@ author: "Julien Brun, Mitchell Maier and Irene Steves, NCEAS" date: "`r Sys.Date()`" output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{"Use Case - Downloading one dataset using metajam"} + %\VignetteIndexEntry{"Use Case - Downloading one dataset from the Arctic Data Center using metajam"} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- From ba130ada266f21ab53f8df8992e373a7f7555d34 Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 14:15:37 -0400 Subject: [PATCH 11/77] Fixing typo in a folder name to be ignored by package build --- .Rbuildignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.Rbuildignore b/.Rbuildignore index 090feea..70d7284 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,7 +1,7 @@ ^Meta$ ^doc$ ^docs$ -^dev/$ +^dev$ ^_pkgdown\.yml$ ^.*\.Rproj$ ^\.Rproj\.user$ From 9bec4c8601f85c9e970af6ac661bc75dbd4cb788 Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 14:21:05 -0400 Subject: [PATCH 12/77] Specifying implied roxygen fields --- R/check_version.R | 6 +++--- man/check_version.Rd | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/check_version.R b/R/check_version.R index a5d45b3..dba8837 100644 --- a/R/check_version.R +++ b/R/check_version.R @@ -1,9 +1,9 @@ -#' Check PID version +#' @title Check PID version #' -#' This function takes an identifier and checks to see if it has been obsoleted. +#' @description This function takes an identifier and checks to see if it has been obsoleted. #' #' @param pid (character) The persistent identifier of a data, metadata, or resource map object on a DataONE member node. -#' @param formatType (character) Optional. The format type to return (one of data, metadata, or resource). +#' @param formatType (character) Optional. The format type to return (one of 'data', 'metadata', or 'resource'). #' #' @return (data.frame) A data frame of object version PIDs and related information. #' diff --git a/man/check_version.Rd b/man/check_version.Rd index 84b8ecf..c658cd1 100644 --- a/man/check_version.Rd +++ b/man/check_version.Rd @@ -9,7 +9,7 @@ check_version(pid, formatType = NULL) \arguments{ \item{pid}{(character) The persistent identifier of a data, metadata, or resource map object on a DataONE member node.} -\item{formatType}{(character) Optional. The format type to return (one of data, metadata, or resource).} +\item{formatType}{(character) Optional. The format type to return (one of 'data', 'metadata', or 'resource').} } \value{ (data.frame) A data frame of object version PIDs and related information. From 0f29b13db57b9d49531468a673c22f83705884b1 Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 14:34:18 -0400 Subject: [PATCH 13/77] `check_version` changes: specified arguments, added comments, and cleaned up line breaks --- R/check_version.R | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/R/check_version.R b/R/check_version.R index dba8837..c275ab8 100644 --- a/R/check_version.R +++ b/R/check_version.R @@ -32,28 +32,28 @@ check_version <- function(pid, formatType = NULL) { - if (!all(is.character(pid), all(nchar(pid) > 0))) { - stop("Argument 'pids' must be character class with non-zero number of characters.") - } - if (!is.null(formatType) && !all(is.character(formatType), length(formatType) == 1, formatType %in% c("data", "metadata", "resource"))) { + # Error out for missing pids + if(all(is.character(pid), nchar(pid) > 0) != TRUE) + stop("Argument 'pid' must be character class with non-zero number of characters.") + + # Error out for missing / unsupported `formatType` specification + if(is.null(formatType) != TRUE & all(is.character(formatType), length(formatType) == 1, formatType %in% c("data", "metadata", "resource")) != TRUE) stop("Argument 'formatType' should either be NULL or one of 'data', 'metadata', or 'resource'.") - } + # Query DataONE for the specified `pid` while (nchar(pid) > 5) { results <- suppressMessages( - dataone::query(dataone::CNode(), - list(q = sprintf('identifier:"%s"', pid), - fl = "identifier, dateUploaded, formatType, obsoletedBy, resourceMap"), + dataone::query(x = dataone::CNode(), + solrQuery = list(q = sprintf('identifier:"%s"', pid), + fl = "identifier, dateUploaded, formatType, obsoletedBy, resourceMap"), as = "data.frame") ) - #if results is null or empty dataframe, remove part of the URI + # If results is null or empty dataframe, remove part of the URI if (is.null(results) || nrow(results) == 0) { - pid <- gsub("^[^/=]+[/=]*", "", pid) + pid <- gsub(pattern = "^[^/=]+[/=]*", replacement = "", x = pid) - } else { - #what to do if multiple are returned - break - } + # If multiple are returned, break + } else { break } } # filter out extra types (resource map/etc with similar pid) @@ -77,5 +77,4 @@ check_version <- function(pid, formatType = NULL) { warning("Several identifiers are associated with ", pid) } - return(results) -} + return(results) } From e261e2eed878cbfa9d243be994fe158f5a21d610 Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 14:42:32 -0400 Subject: [PATCH 14/77] Adding 'internal' keyword to EML/ISO download helper functions --- R/download_EML_data.R | 3 +++ R/download_ISO_data.R | 2 ++ man/download_EML_data.Rd | 1 + man/download_ISO_data.Rd | 1 + 4 files changed, 7 insertions(+) diff --git a/R/download_EML_data.R b/R/download_EML_data.R index 00a0ba7..11b1895 100644 --- a/R/download_EML_data.R +++ b/R/download_EML_data.R @@ -16,6 +16,9 @@ #' @param data_id (character) A data identifier produced by download_d1_data #' @param metadata_nodes (character) The member nodes where this metadata is stored, produced by download_d1_data #' @param path (character) Path to a directory to download data to. +#' +#' @keywords internal +#' download_EML_data <- function(meta_obj, meta_id, data_id, metadata_nodes, path) { diff --git a/R/download_ISO_data.R b/R/download_ISO_data.R index 64b9e31..599b4e0 100644 --- a/R/download_ISO_data.R +++ b/R/download_ISO_data.R @@ -18,6 +18,8 @@ #' @param metadata_nodes (character) The member nodes where this metadata is stored, produced by download_d1_data #' @param path (character) Path to a directory to download data to. #' +#' @keywords internal +#' download_ISO_data <- function(meta_raw, meta_obj, meta_id, data_id, metadata_nodes, path) { diff --git a/man/download_EML_data.Rd b/man/download_EML_data.Rd index 0b03ef5..0c95aeb 100644 --- a/man/download_EML_data.Rd +++ b/man/download_EML_data.Rd @@ -20,3 +20,4 @@ download_EML_data(meta_obj, meta_id, data_id, metadata_nodes, path) \description{ This is an internal function called by the download_d1_data.R function. Not to be exported } +\keyword{internal} diff --git a/man/download_ISO_data.Rd b/man/download_ISO_data.Rd index 9001732..314b662 100644 --- a/man/download_ISO_data.Rd +++ b/man/download_ISO_data.Rd @@ -22,3 +22,4 @@ download_ISO_data(meta_raw, meta_obj, meta_id, data_id, metadata_nodes, path) \description{ This is an internal function called by the download_d1_data.R function. Not to be exported } +\keyword{internal} From ad1e0d933e378afa33014abe90c6d7222677f248 Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 14:56:18 -0400 Subject: [PATCH 15/77] Successfully rebuilt pkgdown locally --- _pkgdown.yml | 5 +- docs/404.html | 134 ++--- docs/LICENSE-text.html | 114 +--- docs/articles/dataset-batch-processing.html | 567 +++++++++++--------- docs/articles/dataset-single.html | 153 +++--- docs/articles/index.html | 142 ++--- docs/articles/package-download.html | 113 ++-- docs/articles/reading-raster.html | 155 +++--- docs/authors.html | 200 +++---- docs/index.html | 173 +++--- docs/pkgdown.css | 83 +-- docs/pkgdown.js | 4 +- docs/pkgdown.yml | 16 +- docs/reference/check_version.html | 185 +++---- docs/reference/download_d1_data.html | 192 +++---- docs/reference/download_d1_data_pkg.html | 178 ++---- docs/reference/index.html | 195 ++----- docs/reference/metajam.html | 125 ++--- docs/reference/read_d1_files.html | 271 ++++------ docs/reference/tabularize_eml.html | 222 +++----- vignettes/dataset-single-DataOne.Rmd | 3 - 21 files changed, 1354 insertions(+), 1876 deletions(-) diff --git a/_pkgdown.yml b/_pkgdown.yml index a1549fc..6b515f6 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -20,6 +20,7 @@ articles: - title: Processing Datasets contents: - dataset-single + - dataset-single-DataOne - dataset-batch-processing - reading-raster - title: Processing Data Packages @@ -39,8 +40,10 @@ navbar: href: articles/index.html menu: - text: Processing Datasets - - text: Use Case 1 - Processing a single dataset + - text: Use Case 1 - Processing a single dataset (Artic Data Center) href: articles/dataset-single.html + - text: Use Case 1B - Processing a single dataset (DataOne) + href: articles/dataset-single-DataOne.html - text: Use Case 2 - Batch processing LTER Luquillo stream chemistry data href: articles/dataset-batch-processing.html - text: Use Case 3 - Processing raster data diff --git a/docs/404.html b/docs/404.html index 57fe6e4..c58a0e5 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1,66 +1,27 @@ - - - - + + + + - Page not found (404) • metajam - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - + + + - - -
+
+
-
- +
+ + - - diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 0bf1197..10a76f4 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -1,66 +1,12 @@ - - - - - - - -License • metajam - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -License • metajam - - - - + + -
-
- -
- -
+
+
-
- +
- - + + diff --git a/docs/articles/dataset-batch-processing.html b/docs/articles/dataset-batch-processing.html index 377ac1b..6cde777 100644 --- a/docs/articles/dataset-batch-processing.html +++ b/docs/articles/dataset-batch-processing.html @@ -19,6 +19,8 @@ + +
+
-
-

-Summary

-

This vignette aims to showcase a use case using the 2 main functions of metajam - download_d1_data and read_d1_files using a data processing workflow developed by the NCO synthesis working group Stream Elemental Cycling.

-

The datasets used are from the LTER site - Luquillo and can be found in the PASTA data repository http://dx.doi.org/doi:10.6073/pasta/f9df56348f510da0113b1e6012fa2967. This data package is a collection of 8 datasets of stream water samples from 8 different locations of the Luquillo Mountains.

-

Our goal is to read the data for the 8 different sampling sites and aggregate them into one harmonized dataset. We will use the metadata to check if the data structures and units are the same across the 8 different sampling sites before performing the aggregation.

+
+

Summary +

+

This vignette aims to showcase a use case using the 2 main functions +of metajam - download_d1_data and +read_d1_files using a data processing workflow developed by +the NCO synthesis working group Stream +Elemental Cycling.

+

The datasets used are from the LTER +site - Luquillo and can be found in the PASTA data repository http://dx.doi.org/doi:10.6073/pasta/f9df56348f510da0113b1e6012fa2967. +This data package is a collection of 8 datasets of stream water samples +from 8 different locations of the Luquillo Mountains.

+

Our goal is to read the data for the 8 different +sampling sites and aggregate them into one harmonized dataset. We will +use the metadata to check if the data structures and units are the same +across the 8 different sampling sites before performing the +aggregation.

-
-

-Libraries

-
-#devtools::install_github("NCEAS/metajam")
-library(metajam)  
-library(udunits2)
-
-# For wrangling the data
-library(readr)
-library(tidyr)
-library(dplyr)
-library(purrr)
-library(stringr)
-
+
+

Libraries +

+
+#devtools::install_github("NCEAS/metajam")
+library(metajam)  
+library(udunits2)
+
+# For wrangling the data
+library(readr)
+library(tidyr)
+library(dplyr)
+library(purrr)
+library(stringr)
-
-

-Constants

-
-# Download the data from DataONE on your local machine
-data_folder <- "Data_SEC"
-
-# Ammonium to Ammoniacal-nitrogen conversion. We will use this conversion later.
-coeff_conv_NH4_to_NH4N <- 0.7764676534
-
+
+

Constants +

+
+# Download the data from DataONE on your local machine
+data_folder <- "Data_SEC"
+
+# Ammonium to Ammoniacal-nitrogen conversion. We will use this conversion later.
+coeff_conv_NH4_to_NH4N <- 0.7764676534
-
-

-Download the datasets

-
-# Create the local directory to store datasets
-dir.create(data_folder, showWarnings = FALSE)
-
-# Get the datasets unique identifiers
-test_datasets_listing <- read_csv(system.file("extdata", "LTER-SEC_DatasetsListing_SearchedData.csv", package = "metajam"))
-
-# Keep only the LUQ related datasets
-luq_test_datasets <- test_datasets_listing %>%
-  filter(grepl("LUQ", .$`LTER site abbreviation`)) %>%
-  select(`LTER site abbreviation`,
-         `Data Repository (PASTA) URL to Archive/Metadata`,
-         `Data Repository (PASTA) URL to File`,
-         `Data Repository (PASTA) Filename`) %>%
-  na.omit() %>%
-  arrange(`Data Repository (PASTA) Filename`) # sort the data sets alphabetically
-
-## Batch download the datasets
-
-# the tidiest way
-local_datasets <- map(luq_test_datasets$`Data Repository (PASTA) URL to File`, ~download_d1_data(.x, data_folder))
-
-# the apply way
-# local_datasets <- lapply(luq_test_datasets$`Data Repository (PASTA) URL to File`, download_d1_data, data_folder)
-
-# the map way
-# local_datasets <- map(luq_test_datasets$`Data Repository (PASTA) URL to File`, function(x) {download_d1_data(x, data_folder)})
-
-

At this point, you should have all the data and the metadata downloaded inside your main directory; Data_SEC in this example. metajam organize the files as follow:

+
+

Download the datasets +

+
+# Create the local directory to store datasets
+dir.create(data_folder, showWarnings = FALSE)
+
+# Get the datasets unique identifiers
+test_datasets_listing <- read_csv(system.file("extdata", "LTER-SEC_DatasetsListing_SearchedData.csv", package = "metajam"))
+
+# Keep only the LUQ related datasets
+luq_test_datasets <- test_datasets_listing %>%
+  filter(grepl("LUQ", .$`LTER site abbreviation`)) %>%
+  select(`LTER site abbreviation`,
+         `Data Repository (PASTA) URL to Archive/Metadata`,
+         `Data Repository (PASTA) URL to File`,
+         `Data Repository (PASTA) Filename`) %>%
+  na.omit() %>%
+  arrange(`Data Repository (PASTA) Filename`) # sort the data sets alphabetically
+
+## Batch download the datasets
+
+# the tidiest way
+local_datasets <- map(luq_test_datasets$`Data Repository (PASTA) URL to File`, ~download_d1_data(.x, data_folder))
+
+# the apply way
+# local_datasets <- lapply(luq_test_datasets$`Data Repository (PASTA) URL to File`, download_d1_data, data_folder)
+
+# the map way
+# local_datasets <- map(luq_test_datasets$`Data Repository (PASTA) URL to File`, function(x) {download_d1_data(x, data_folder)})
+

At this point, you should have all the data and the metadata +downloaded inside your main directory; Data_SEC in this +example. metajam organize the files as follow:

    -
  • Each dataset is stored a sub-directory named after the package DOI and the file name
  • +
  • Each dataset is stored a sub-directory named after the package DOI +and the file name
  • Inside this sub-directory, you will find
    • the data: my_data.csv
    • -
    • the raw EML with the naming convention file name + __full_metadata.xml: my_data__full_metadata.xml +
    • the raw EML with the naming convention file name + +__full_metadata.xml: +my_data__full_metadata.xml
    • -
    • the package level metadata summary with the naming convention file name + __summary_metadata.csv: my_data__summary_metadata.csv +
    • the package level metadata summary with the naming convention +file name + __summary_metadata.csv: +my_data__summary_metadata.csv
    • -
    • If relevant, the attribute level metadata with the naming convention file name + __attribute_metadata.csv: my_data__attribute_metadata.csv +
    • If relevant, the attribute level metadata with the naming convention +file name + __attribute_metadata.csv: +my_data__attribute_metadata.csv
    • -
    • If relevant, the factor level metadata with the naming convention file name + __attribute_factor_metadata.csv: my_data__attribute_factor_metadata.csv +
    • If relevant, the factor level metadata with the naming convention +file name + __attribute_factor_metadata.csv: +my_data__attribute_factor_metadata.csv
-
-

-Read the data and metadata in your R environment

-
-# You could list the datasets dowloaded in the `Data_SEC` folder 
-# local_datasets <- dir(data_folder, full.names = TRUE)
-
-# or you can directly use the outputed paths from download_d1_data 
-# Read all the datasets and their associated metadata in as a named list
-luq_datasets <- map(local_datasets, read_d1_files) %>% 
-  set_names(map(., ~.x$summary_metadata$value[.x$summary_metadata$name == "File_Name"]))
-
+
+

Read the data and metadata in your R environment +

+
+# You could list the datasets dowloaded in the `Data_SEC` folder 
+# local_datasets <- dir(data_folder, full.names = TRUE)
+
+# or you can directly use the outputed paths from download_d1_data 
+# Read all the datasets and their associated metadata in as a named list
+luq_datasets <- map(local_datasets, read_d1_files) %>% 
+  set_names(map(., ~.x$summary_metadata$value[.x$summary_metadata$name == "File_Name"]))
-
-

-Perform checks on data structure

-

Is the data structure the same across sampling sites (datasets)? For example, do the datasets all have the same column names?

-
-# list all the attributes
-attributes_luq <- luq_datasets %>% map("data") %>% map(colnames)
-
-# Check if they are identical by comparing all against the first site
-for(ds in names(attributes_luq)) {
-  print(identical(attributes_luq[[1]], attributes_luq[[ds]]))
-}
-
-#> => We are good, same data structure across the sampling sites
-
-
-

-Conclusion

+
+

Perform checks on data structure +

+

Is the data structure the same across sampling sites (datasets)? For +example, do the datasets all have the same column names?

+
+# list all the attributes
+attributes_luq <- luq_datasets %>% map("data") %>% map(colnames)
+
+# Check if they are identical by comparing all against the first site
+for(ds in names(attributes_luq)) {
+  print(identical(attributes_luq[[1]], attributes_luq[[ds]]))
+}
+
+#> => We are good, same data structure across the sampling sites
+
+

Conclusion +

    -
  • the same attributes are reported at the different sampling sites
  • +
  • the same attributes are reported at the different sampling +sites
-
-

-Perform checks on the units

-

Is data reported in identical units? For example, in every dataset is CI reported in microgramsPerLiter?

-
-# List all the units used
-luq_units <- luq_datasets %>% map("attribute_metadata") %>% map(~.[["unit"]])
-
-# Check if they are identical by comparing all against the first site
-for(us in names(luq_units)) {
-  print(identical(luq_units[[1]], luq_units[[us]]))
-}
-
-#>!!! => The 2 last datasets have different units!!!!!!!!!!
-
-# Let's check the differences
-luq_units_merged <- luq_datasets %>%
-  map("attribute_metadata") %>%
-  map(. %>% select(attributeName, unit)) %>%
-  reduce(full_join, by = "attributeName") 
-
-## Rename
-# Create the new names
-luq_new_colnames <- names(luq_units) %>%
-  str_split("[.]") %>%
-  map(~.[1]) %>%
-  paste("unit", ., sep = "_")
-
-# Apply the new names
-colnames(luq_units_merged) <- c("attributeName", luq_new_colnames)
-
-
-

-Conclusion

+
+

Perform checks on the units +

+

Is data reported in identical units? For example, in every dataset is +CI reported in microgramsPerLiter?

+
+# List all the units used
+luq_units <- luq_datasets %>% map("attribute_metadata") %>% map(~.[["unit"]])
+
+# Check if they are identical by comparing all against the first site
+for(us in names(luq_units)) {
+  print(identical(luq_units[[1]], luq_units[[us]]))
+}
+
+#>!!! => The 2 last datasets have different units!!!!!!!!!!
+
+# Let's check the differences
+luq_units_merged <- luq_datasets %>%
+  map("attribute_metadata") %>%
+  map(. %>% select(attributeName, unit)) %>%
+  reduce(full_join, by = "attributeName") 
+
+## Rename
+# Create the new names
+luq_new_colnames <- names(luq_units) %>%
+  str_split("[.]") %>%
+  map(~.[1]) %>%
+  paste("unit", ., sep = "_")
+
+# Apply the new names
+colnames(luq_units_merged) <- c("attributeName", luq_new_colnames)
+
+

Conclusion +

    -
  • For the 2 last sampling sites RioIcacos and RioMameyesPuenteRoto, the units used for the gage height (“Gage_Ht”) are in feet and not meters like the other sites
  • -
  • For the 2 last sampling sites RioIcacos and RioMameyesPuenteRoto, NH4 and not NH4-N is measured
  • +
  • For the 2 last sampling sites RioIcacos and +RioMameyesPuenteRoto, the units used for the gage height +(“Gage_Ht”) are in feet and not meters like the other sites
  • +
  • For the 2 last sampling sites RioIcacos and +RioMameyesPuenteRoto, NH4 and not +NH4-N is measured
-
-

-Fixing units discrepancies

-
-# fix attribute naming discrepancies -- to be improved 
-# Copy the units for Gage height
-luq_units_merged <- luq_units_merged %>% 
-  mutate(unit_RioIcacos = ifelse(attributeName == "Gage_Ht", "foot", unit_RioIcacos),
-         unit_RioMameyesPuenteRoto = ifelse(attributeName == "Gage_Ht", "foot", unit_RioMameyesPuenteRoto))
-
-
-# Copy the units for NH4
-luq_units_merged <- luq_units_merged %>% 
-  mutate(unit_RioIcacos = ifelse(attributeName == "NH4-N", "microgramsPerLiter", unit_RioIcacos),
-         unit_RioMameyesPuenteRoto = ifelse(attributeName == "NH4-N", "microgramsPerLiter", unit_RioMameyesPuenteRoto))
-
-
-# drop the 2 last rows
-luq_units_merged <- head(luq_units_merged, -2)
-
-
-### Implement the unit conversion for RioIcacos and RioMameyesPuenteRoto ----
-
-# Simplify naming
-RioIcacos_data <- luq_datasets$RioIcacos$data
-RioIcacos_attrmeta <- luq_datasets$RioIcacos$attribute_metadata
-
-
-## RioIcacos
-# Fix NAs. In this dataset "-9999" is the missing value code. So we need to replace those with NAs
-RioIcacos_data <- na_if(RioIcacos_data, "-9999")
-
-# Do the unit conversion  
-
-#Check to see if you can use the udunits package to convert feet to meters
-
-ud.are.convertible("foot", "meter")
-
-#TRUE, so we can use udunits to do the conversion
-
-# Do the unit conversion in both the data file and the attributes file  - Gage height - udunits way
-
-RioIcacos_data$Gage_Ht <- ud.convert(RioIcacos_data$Gage_Ht, "foot", "meter")
-
-RioIcacos_attrmeta$unit <-  str_replace_all(RioIcacos_attrmeta$unit, pattern = "foot", replacement = "meter")
-
-
-# If we could NOT use udunits to do the conversion we could do it manually this way 
-
-#RioIcacos_data <- RioIcacos_data %>% mutate( `Gage_Ht` = `Gage_Ht`* 0.3048)
-
-# Do the unit conversion for RioIcacos and RioMameyesPuenteRoto - NH4 to NH4-N
-
-#Check to see if you can use udunits to convert the measurements you want to convert.
-
-ud.are.convertible("NH4", "NH4-N")
-
-#FALSE = Udunits cannot convert these units for us so we will manually convert using the input below
-
-# Ammonium to Ammoniacal-nitrogen conversion
-coeff_conv_NH4_to_NH4N <- 0.7764676534
-
-
-# Unit conversion for RioIcacos and RioMameyesPuenteRoto - NH4 to NH4-N
-RioIcacos_data <- RioIcacos_data %>% mutate( `NH4-N` = `NH4-N`* coeff_conv_NH4_to_NH4N)
-
-
-# Update the main object 
-luq_datasets$RioIcacos$data <- RioIcacos_data
-
-
-## RioMameyesPuenteRoto
-
-# Simplify naming
-RioMameyesPuenteRoto_data <- luq_datasets$RioMameyesPuenteRoto$data
-RioMameyesPuenteRoto_attrmeta <- luq_datasets$RioMameyesPuenteRoto$attribute_metadata
-
-#Replace all cells with the missing value code ("-9999") with "NA"
-RioMameyesPuenteRoto_data <- na_if(RioMameyesPuenteRoto_data, "-9999")
-
-#Tidy version of unit conversion 
-
-RioMameyesPuenteRoto_data$Gage_Ht <- ud.convert(RioMameyesPuenteRoto_data$Gage_Ht, "foot", "meter")
-RioMameyesPuenteRoto_attrmeta$unit <-  str_replace_all (RioMameyesPuenteRoto_attrmeta$unit, pattern = "foot", replacement = "meter")
-
-# Do the unit conversion for RioMameyesPuenteRoto - NH4 to NH4-N (recall that we cannot use udunits for this so we are doing it manually)
-
-#In this dataset the NH4-N column is actually empty, so this is not necessary. But here is how you would do it if you had to.
-
-
-RioMameyesPuenteRoto_data <- RioMameyesPuenteRoto_data %>% mutate( `NH4-N` = `NH4-N`* coeff_conv_NH4_to_NH4N)
-
-# Update the main object
-luq_datasets$RioMameyesPuenteRoto$data <- RioMameyesPuenteRoto_data 
-
-                                                
-
+
+

Fixing units discrepancies +

+
+# fix attribute naming discrepancies -- to be improved 
+# Copy the units for Gage height
+luq_units_merged <- luq_units_merged %>% 
+  mutate(unit_RioIcacos = ifelse(attributeName == "Gage_Ht", "foot", unit_RioIcacos),
+         unit_RioMameyesPuenteRoto = ifelse(attributeName == "Gage_Ht", "foot", unit_RioMameyesPuenteRoto))
+
+
+# Copy the units for NH4
+luq_units_merged <- luq_units_merged %>% 
+  mutate(unit_RioIcacos = ifelse(attributeName == "NH4-N", "microgramsPerLiter", unit_RioIcacos),
+         unit_RioMameyesPuenteRoto = ifelse(attributeName == "NH4-N", "microgramsPerLiter", unit_RioMameyesPuenteRoto))
+
+
+# drop the 2 last rows
+luq_units_merged <- head(luq_units_merged, -2)
+
+
+### Implement the unit conversion for RioIcacos and RioMameyesPuenteRoto ----
+
+# Simplify naming
+RioIcacos_data <- luq_datasets$RioIcacos$data
+RioIcacos_attrmeta <- luq_datasets$RioIcacos$attribute_metadata
+
+
+## RioIcacos
+# Fix NAs. In this dataset "-9999" is the missing value code. So we need to replace those with NAs
+RioIcacos_data <- na_if(RioIcacos_data, "-9999")
+
+# Do the unit conversion  
+
+#Check to see if you can use the udunits package to convert feet to meters
+
+ud.are.convertible("foot", "meter")
+
+#TRUE, so we can use udunits to do the conversion
+
+# Do the unit conversion in both the data file and the attributes file  - Gage height - udunits way
+
+RioIcacos_data$Gage_Ht <- ud.convert(RioIcacos_data$Gage_Ht, "foot", "meter")
+
+RioIcacos_attrmeta$unit <-  str_replace_all(RioIcacos_attrmeta$unit, pattern = "foot", replacement = "meter")
+
+
+# If we could NOT use udunits to do the conversion we could do it manually this way 
+
+#RioIcacos_data <- RioIcacos_data %>% mutate( `Gage_Ht` = `Gage_Ht`* 0.3048)
+
+# Do the unit conversion for RioIcacos and RioMameyesPuenteRoto - NH4 to NH4-N
+
+#Check to see if you can use udunits to convert the measurements you want to convert.
+
+ud.are.convertible("NH4", "NH4-N")
+
+#FALSE = Udunits cannot convert these units for us so we will manually convert using the input below
+
+# Ammonium to Ammoniacal-nitrogen conversion
+coeff_conv_NH4_to_NH4N <- 0.7764676534
+
+
+# Unit conversion for RioIcacos and RioMameyesPuenteRoto - NH4 to NH4-N
+RioIcacos_data <- RioIcacos_data %>% mutate( `NH4-N` = `NH4-N`* coeff_conv_NH4_to_NH4N)
+
+
+# Update the main object 
+luq_datasets$RioIcacos$data <- RioIcacos_data
+
+
+## RioMameyesPuenteRoto
+
+# Simplify naming
+RioMameyesPuenteRoto_data <- luq_datasets$RioMameyesPuenteRoto$data
+RioMameyesPuenteRoto_attrmeta <- luq_datasets$RioMameyesPuenteRoto$attribute_metadata
+
+#Replace all cells with the missing value code ("-9999") with "NA"
+RioMameyesPuenteRoto_data <- na_if(RioMameyesPuenteRoto_data, "-9999")
+
+#Tidy version of unit conversion 
+
+RioMameyesPuenteRoto_data$Gage_Ht <- ud.convert(RioMameyesPuenteRoto_data$Gage_Ht, "foot", "meter")
+RioMameyesPuenteRoto_attrmeta$unit <-  str_replace_all (RioMameyesPuenteRoto_attrmeta$unit, pattern = "foot", replacement = "meter")
+
+# Do the unit conversion for RioMameyesPuenteRoto - NH4 to NH4-N (recall that we cannot use udunits for this so we are doing it manually)
+
+#In this dataset the NH4-N column is actually empty, so this is not necessary. But here is how you would do it if you had to.
+
+
+RioMameyesPuenteRoto_data <- RioMameyesPuenteRoto_data %>% mutate( `NH4-N` = `NH4-N`* coeff_conv_NH4_to_NH4N)
+
+# Update the main object
+luq_datasets$RioMameyesPuenteRoto$data <- RioMameyesPuenteRoto_data 
+
+                                                
-
-

-Append all the sampling sites into one master dataset

-
-# bind the sampling sites data into one master dataset for LUQ
-all_sites_luq <- luq_datasets %>%
-  map("data") %>% 
-  bind_rows(.id = "prov")
-
-# Replace -9999 with NAs
-all_sites_luq <- na_if(all_sites_luq, "-9999")
-
-# Write as csv
-write_csv(all_sites_luq, "stream_chem_all_LUQ.csv")
-
+
+

Append all the sampling sites into one master dataset +

+
+# bind the sampling sites data into one master dataset for LUQ
+all_sites_luq <- luq_datasets %>%
+  map("data") %>% 
+  bind_rows(.id = "prov")
+
+# Replace -9999 with NAs
+all_sites_luq <- na_if(all_sites_luq, "-9999")
+
+# Write as csv
+write_csv(all_sites_luq, "stream_chem_all_LUQ.csv")
-
-

-General Conclusion

+
+

General Conclusion +

    -
  • Although the column names were the same in all the datasets / sampling sites, looking at the metadata we discovered that 2 sampling sites are measuring stream gage height and NH4 concentration using different protocols.
  • -
  • We used the metadata to perform the necessary unit conversions to homogenize the 8 datasets before merging them into one master dataset.
  • -
  • During the merge process, we added a provenance column to be able to track the origin of each row, allowing users of the master datasets to check the original datasets metadata when necessary.
  • +
  • Although the column names were the same in all the datasets / +sampling sites, looking at the metadata we discovered that 2 sampling +sites are measuring stream gage height and NH4 concentration using +different protocols.
  • +
  • We used the metadata to perform the necessary unit conversions to +homogenize the 8 datasets before merging them into one master +dataset.
  • +
  • During the merge process, we added a provenance column to be able to +track the origin of each row, allowing users of the master datasets to +check the original datasets metadata when necessary.
@@ -398,11 +433,13 @@

-

Site built with pkgdown 1.6.0.

+

+

Site built with pkgdown 2.0.7.

@@ -411,5 +448,7 @@

+ + diff --git a/docs/articles/dataset-single.html b/docs/articles/dataset-single.html index 39eafbe..f44db25 100644 --- a/docs/articles/dataset-single.html +++ b/docs/articles/dataset-single.html @@ -19,6 +19,8 @@ + +
+
-
-

-Summary

-

This vignette aims to showcase a use case using the 2 main functions of metajam - download_d1_data and read_d1_files to download one dataset from the Arctic Data Center data repository.

-

As example, we are using permafrost data from the Polaris Project 2017: Sarah Ludwig, Robert M Holmes, Susan Natali, Paul Mann, John Schade, et al. 2018. Polaris Project 2017: Permafrost carbon and nitrogen, Yukon-Kuskokwim Delta, Alaska. Arctic Data Center. doi:10.18739/A2KK3F.

+
+

Summary +

+

This vignette aims to showcase a use case using the 2 main functions +of metajam - download_d1_data and +read_d1_files to download one dataset from the Arctic Data Center data +repository.

+

As example, we are using permafrost data from the Polaris Project +2017: Sarah Ludwig, Robert M Holmes, Susan Natali, Paul Mann, John +Schade, et al. 2018. Polaris Project 2017: Permafrost carbon and +nitrogen, Yukon-Kuskokwim Delta, Alaska. Arctic Data Center. doi:10.18739/A2KK3F.

-
-

-Libraries and constants

-
-# devtools::install_github("NCEAS/metajam")
-library(metajam)  
-
-
-# Directory to save the data set
-path_folder <- "Data_polaris"
-
-# URL to download the dataset from DataONE
-data_url <- "https://arcticdata.io/metacat/d1/mn/v2/object/urn%3Auuid%3Aec704da8-f174-49db-b993-bae479cdc5d9"
-
+
+

Libraries and constants +

+
+# devtools::install_github("NCEAS/metajam")
+library(metajam)  
+
+# Directory to save the data set
+path_folder <- "Data_polaris"
+
+# URL to download the dataset from DataONE
+data_url <- "https://arcticdata.io/metacat/d1/mn/v2/object/urn%3Auuid%3Aec704da8-f174-49db-b993-bae479cdc5d9"
-
-

-Download the dataset

-
-# Create the local directory to download the datasets
-dir.create(path_folder, showWarnings = FALSE)
-
-# Download the dataset and associated metdata 
-data_folder <- metajam::download_d1_data(data_url, path_folder)
-# data_folder
-# "Data_polaris/doi_10.18739_A2KK3F__Polaris_2017_Permafrost"
-
-

At this point, you should have the data and the metadata downloaded inside your main directory; Data_polaris in this example. metajam organize the files as follow:

+
+

Download the dataset +

+
+# Create the local directory to download the datasets
+dir.create(path_folder, showWarnings = FALSE)
+
+# Download the dataset and associated metdata 
+data_folder <- metajam::download_d1_data(data_url, path_folder)
+# data_folder
+# "Data_polaris/doi_10.18739_A2KK3F__Polaris_2017_Permafrost"
+

At this point, you should have the data and the metadata downloaded +inside your main directory; Data_polaris in this example. +metajam organize the files as follow:

    -
  • Each dataset is stored a sub-directory named after the package DOI and the file name
  • +
  • Each dataset is stored a sub-directory named after the package DOI +and the file name
  • Inside this sub-directory, you will find
    • the data: my_data.csv
    • -
    • the raw EML with the naming convention file name + __full_metadata.xml: my_data__full_metadata.xml +
    • the raw EML with the naming convention file name + +__full_metadata.xml: +my_data__full_metadata.xml
    • -
    • the package level metadata summary with the naming convention file name + __summary_metadata.csv: my_data__summary_metadata.csv +
    • the package level metadata summary with the naming convention +file name + __summary_metadata.csv: +my_data__summary_metadata.csv
    • -
    • If relevant, the attribute level metadata with the naming convention file name + __attribute_metadata.csv: my_data__attribute_metadata.csv +
    • If relevant, the attribute level metadata with the naming convention +file name + __attribute_metadata.csv: +my_data__attribute_metadata.csv
    • -
    • If relevant, the factor level metadata with the naming convention file name + __attribute_factor_metadata.csv: my_data__attribute_factor_metadata.csv +
    • If relevant, the factor level metadata with the naming convention +file name + __attribute_factor_metadata.csv: +my_data__attribute_factor_metadata.csv
-Local file structure of a dataset downloaded by metajam

+Local file structure of a dataset downloaded by metajam

Local file structure of a dataset downloaded by metajam

-
-

-Read the data and metadata in your R environment

-
-# Read all the datasets and their associated metadata in as a named list
-polaris17_permafrost <- metajam::read_d1_files(data_folder)
-
+
+

Read the data and metadata in your R environment +

+
+# Read all the datasets and their associated metadata in as a named list
+polaris17_permafrost <- metajam::read_d1_files(data_folder)
-
-

-Structure of the named list object

-

You have now loaded in your R environment one named list object that contains the data polaris17_permafrost$data, the general (summary) metadata polaris17_permafrost$summary_metadata - such as title, creators, dates, locations - and the attribute level metadata information polaris17_permafrost$attribute_metadata, allowing user to get more information, such as units and definitions of your attributes.

+
+

Structure of the named list object +

+

You have now loaded in your R environment one named list object that +contains the data polaris17_permafrost$data, the general +(summary) metadata polaris17_permafrost$summary_metadata - +such as title, creators, dates, locations - and the attribute level +metadata information +polaris17_permafrost$attribute_metadata, allowing user to +get more information, such as units and definitions of your +attributes.

-Structure of the named list object containing tabular metadata and data as loaded by metajam

-Structure of the named list object containing tabular metadata and data as loaded by metajam +Structure of the named list object containing tabular metadata and data as loaded by metajam

+Structure of the named list object containing tabular metadata and data +as loaded by metajam

@@ -190,11 +217,13 @@

-

Site built with pkgdown 1.6.0.

+

+

Site built with pkgdown 2.0.7.

@@ -203,5 +232,7 @@

+ + diff --git a/docs/articles/index.html b/docs/articles/index.html index a05e042..426150e 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -1,66 +1,12 @@ - - - - - - - -Articles • metajam - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Articles • metajam - + + - - - -
-
- -
- -

-
- +
- - + + diff --git a/docs/articles/package-download.html b/docs/articles/package-download.html index 86b112b..d108cdf 100644 --- a/docs/articles/package-download.html +++ b/docs/articles/package-download.html @@ -19,6 +19,8 @@ + +
+
-
-

-Summary

-

This vignette aims to showcase a use case when the user wants to download all the datasets of a data package using metajam - download_d1_data_pkg.

-

In this example we use a csv file storing packages returned after searching for soil bulk density on Arctic Data Center and KNB data repositories.

+
+

Summary +

+

This vignette aims to showcase a use case when the user wants to +download all the datasets of a data package using metajam - +download_d1_data_pkg.

+

In this example we use a csv file storing packages returned after +searching for soil bulk density on Arctic Data Center and KNB data repositories.

-
-

-Libraries and constants

-
-# devtools::install_github("NCEAS/metajam")
-library(metajam)  
-library(readr)
-library(purrr)
-
-
-# Directory to save the data set
-path_folder <- "./Soil_bulk"
-
-# URL to read the search results stored as a csv on Google Drive
-csv_search_results_url <- "https://drive.google.com/uc?export=download&id=1WTLP2BcXCXmUyv4kmntyhuPfrBNdPIqV"
-
+
+

Libraries and constants +

+
+# devtools::install_github("NCEAS/metajam")
+library(metajam)  
+library(readr)
+library(purrr)
+
+# Directory to save the data set
+path_folder <- "./Soil_bulk"
+
+# URL to read the search results stored as a csv on Google Drive
+csv_search_results_url <- "https://drive.google.com/uc?export=download&id=1WTLP2BcXCXmUyv4kmntyhuPfrBNdPIqV"
-
-

-Download all the datasets from data packages using DOIs

-
-# Create the local directory to store data sets
-dir.create(path_folder, showWarnings = FALSE)
-
-# Read the data listing from Google Drive: https://drive.google.com/open?id=1WTLP2BcXCXmUyv4kmntyhuPfrBNdPIqV
-data_listing <- read_csv(csv_search_results_url)
-
-
-### Download the data and metadata ----
-
-# Create the list of unique dois
-dois <- unique(data_listing$identifier)
-
-# batch download the datasets
-data_folders <- map(dois, ~download_d1_data_pkg(.x, path_folder))
-
+
+

Download all the datasets from data packages using DOIs +

+
+# Create the local directory to store data sets
+dir.create(path_folder, showWarnings = FALSE)
+
+# Read the data listing from Google Drive: https://drive.google.com/open?id=1WTLP2BcXCXmUyv4kmntyhuPfrBNdPIqV
+data_listing <- read_csv(csv_search_results_url)
+
+
+### Download the data and metadata ----
+
+# Create the list of unique dois
+dois <- unique(data_listing$identifier)
+
+# batch download the datasets
+data_folders <- map(dois, ~download_d1_data_pkg(.x, path_folder))
@@ -158,11 +165,13 @@

-

Site built with pkgdown 1.6.0.

+

+

Site built with pkgdown 2.0.7.

@@ -171,5 +180,7 @@

+ + diff --git a/docs/articles/reading-raster.html b/docs/articles/reading-raster.html index 7d0dc9c..0bb8100 100644 --- a/docs/articles/reading-raster.html +++ b/docs/articles/reading-raster.html @@ -19,6 +19,8 @@ + +
+
-
-

-Summary

-

This vignette aims to showcase how to overwrite the default function used by metajam::read_d1_files (spoiler alert it is readr::read_csv) to read none tabular dara. In this specific vignette, we use the example of reading a geotiff file using the raster package.

-

As example, we are using shipping routes frequency data used in the final human impacts model of 17 marine ecosystems and the 22 stressor drivers DOI: 10.5063/F15M63Z8.. For more information on this research, please see Micheli F, Halpern BS, Walbridge S, Ciriaco S, Ferretti F, Fraschetti S, et al. (2013) Cumulative Human Impacts on Mediterranean and Black Sea Marine Ecosystems: Assessing Current Pressures and Opportunities. PLoS ONE 8(12). https://doi.org/10.1371/journal.pone.0079889.

+
+

Summary +

+

This vignette aims to showcase how to overwrite the default function +used by metajam::read_d1_files (spoiler alert it is +readr::read_csv) to read none tabular dara. In this +specific vignette, we use the example of reading a geotiff file using +the raster package.

+

As example, we are using shipping routes frequency data used in the +final human impacts model of 17 marine ecosystems and the 22 stressor +drivers DOI: +10.5063/F15M63Z8.. For more information on this research, please see +Micheli F, Halpern BS, Walbridge S, Ciriaco S, Ferretti F, Fraschetti S, +et al. (2013) Cumulative Human Impacts on Mediterranean and Black Sea +Marine Ecosystems: Assessing Current Pressures and Opportunities. PLoS +ONE 8(12). https://doi.org/10.1371/journal.pone.0079889.

-
-

-Libraries and constants

-
-# devtools::install_github("NCEAS/metajam")
-library(metajam)
-library(raster)
-library(magrittr)
-
-
-# Directory to save the data set
-path_folder <- "Human_impacts"
-
-# URL to download the dataset from DataONE
-data_url <- "https://cn.dataone.org/cn/v2/resolve/urn:uuid:6f101827-2fc3-43da-8c8d-7b1f927c4c73"
-
+
+

Libraries and constants +

+
+# devtools::install_github("NCEAS/metajam")
+library(metajam)
+library(raster)
+library(magrittr)
+
+# Directory to save the data set
+path_folder <- "Human_impacts"
+
+# URL to download the dataset from DataONE
+data_url <- "https://cn.dataone.org/cn/v2/resolve/urn:uuid:6f101827-2fc3-43da-8c8d-7b1f927c4c73"
-
-

-Download the raster dataset

-
-# Create the local directory to download the datasets
-dir.create(path_folder, showWarnings = FALSE)
-
-# Download the dataset and associated metdata 
-data_folder <- metajam::download_d1_data(data_url, path_folder)
-# data_folder
-# "Human_impacts/doi_10.5063_F15M63Z8__shipping__tif"
-
-

At this point, you should have the data and the metadata downloaded inside your main directory; human_impacts in this example. metajam organize the files as follow:

+
+

Download the raster dataset +

+
+# Create the local directory to download the datasets
+dir.create(path_folder, showWarnings = FALSE)
+
+# Download the dataset and associated metdata 
+data_folder <- metajam::download_d1_data(data_url, path_folder)
+# data_folder
+# "Human_impacts/doi_10.5063_F15M63Z8__shipping__tif"
+

At this point, you should have the data and the metadata downloaded +inside your main directory; human_impacts in this example. +metajam organize the files as follow:

    -
  • Each dataset is stored a sub-directory named after the package DOI and the file name
  • +
  • Each dataset is stored a sub-directory named after the package DOI +and the file name
  • Inside this sub-directory, you will find
    • the data: shipping.tif
    • -
    • the raw EML with the naming convention file name + __full_metadata.xml: shipping__full_metadata.xml +
    • the raw EML with the naming convention file name + +__full_metadata.xml: +shipping__full_metadata.xml
    • -
    • the package level metadata summary with the naming convention file name + __summary_metadata.csv: shipping__summary_metadata.csv +
    • the package level metadata summary with the naming convention +file name + __summary_metadata.csv: +shipping__summary_metadata.csv
-
-

-Read the raster file and metadata in your R environment

-
-# Read the raster file and its associated metadata in as a named list
-# using the raster:raster function
-shipping_routes <-  read_d1_files(data_folder, "raster")
-
-# Plot the raster data
-plot(shipping_routes$data)
-
+
+

Read the raster file and metadata in your R environment +

+
+# Read the raster file and its associated metadata in as a named list
+# using the raster:raster function
+shipping_routes <-  read_d1_files(data_folder, "raster")
+
+# Plot the raster data
+plot(shipping_routes$data)
-Shipping routes frequency

+Shipping routes frequency

Shipping routes frequency

-
-

-Investigate the metadata

-
-shipping_routes$summary_metadata
-
-

+
+

Investigate the metadata +

+
+shipping_routes$summary_metadata
+

@@ -190,11 +209,13 @@

-

Site built with pkgdown 1.6.0.

+

+

Site built with pkgdown 2.0.7.

@@ -203,5 +224,7 @@

+ + diff --git a/docs/authors.html b/docs/authors.html index 652d2b1..53d0abf 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,66 +1,12 @@ - - - - - - - -Authors • metajam - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Authors and Citation • metajam - - + + - - - -
-
-
- -
+
- @@ -170,22 +136,20 @@

Authors

-
- +
- - + + diff --git a/docs/index.html b/docs/index.html index 831466b..edea5c2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5,20 +5,23 @@ -Tools to Download Data and Metadata from DataONE • metajam +Easily Download Data and Metadata from DataONE • metajam - - + + + +
-

-
- -

Travis-CI Build Status CRAN_Status_Badge

+

+
+ + +

Download and read data and metadata from repositories in the DataONE network.

-
-

-Authors

+
+

Authors +

Irene Steves, Mitchell Maier and Julien Brun; NCEAS

-
-

-Installation

-

The metajam package can be installed from GitHub using the devtools package:

-
#install.packages("devtools")
-devtools::install_github('NCEAS/metajam')
+
+

Installation +

+

The metajam package can be installed from CRAN:

+
+install.packages("metajam")
+

The development version of metajam package can also be installed from GitHub using the devtools package:

+
+#install.packages("devtools")
+devtools::install_github('NCEAS/metajam')
+
+
+

Workflow +

+

The process of using metajam is as follows:

+
    +
  1. Get the URL for the dataset to download
  2. +
  3. Download the data and metadata (metajam::download_d1_data)
  4. +
  5. Read the data and metadata into R (metajam::read_d1_files)
  6. +
+

These steps are described in greater detail–with included examples–below.

-
-

-Download data

+
+

How to get the URL to your dataset of interest ? +

+

From DataONE or any currently supported data repository (KNB, Arctic Data Center, or EDI/LTER), you can right-click on the Download button of a specific dataset and choose Copy Link Address to copy the URL to your clipboard

+



+
+
+

Download data +

To download a data object, specify the data object URL and local download path in the download_d1_data function:

-
library(metajam)
-
-download_d1_data("https://arcticdata.io/metacat/d1/mn/v2/object/urn%3Auuid%3A9e123f84-ce0d-4094-b898-c9e73680eafa", path = ".")
-





+
library(metajam)
+
+download_d1_data("https://arcticdata.io/metacat/d1/mn/v2/object/urn%3Auuid%3A9e123f84-ce0d-4094-b898-c9e73680eafa", path = ".")
+





The output is saved in a folder with the name {metadata_id}__{file_name}, which contains the data file and its associated metadata. The metadata follows these conventions:

  • -{file_name}__summary_metadata.csv - summary metadata in a tabular format, which includes date downloaded, data file name, file/metadata URL’s, etc.
  • +{file_name}__summary_metadata.csv - summary metadata in a tabular format, which includes date downloaded, data file name, file/metadata URLs, etc.
  • {file_name}__full_metadata.xml - metadata xml file, if it could be downloaded
  • @@ -128,40 +156,39 @@

    {file_name}__attribute_factor_metadata.csv - attribute factor metadata in a tabular format, if included in the metadata xml

-
-

-How to get the URL to your dataset of interest ?

-

From DataONE or any currently supported data repository (KNB, Arctic Data Center, LTER PASTA or EDI), you can right-click on the Download button of a specific dataset and choose Copy Link Address to copy the URL to your clipboard

-



-
-
-

-Read data

+
+

Read data +

The read_d1_files function allows you to read the downloaded data and metadata directly into your R environment. Simply run the function with the folder path to the downloaded objects, and all data and metadata files will be returned as data frames stored in a list. Use {object_name}$data to access the data, and {object_name}${metadata_type}_metadata to access its associated metadata.

-
schools <- read_d1_files("./doi_10.18739_A2DP3X__Alaska_Schools_Rentention2009_15")
-



+
schools <- read_d1_files("./doi_10.18739_A2DP3X__Alaska_Schools_Rentention2009_15")
+



-
-

-Quick Overview of metajam +
+

Additional resources for metajam +

-
-

-Acknowledgements

+
+

Acknowledgements +

Work on this package was supported by:

  • NSF-PLR grant #1546024 to M. B. Jones, S. Baker-Yeboah, J. Dozier, M. Schildhauer, and A. Budden
  • Long Term Ecological Research (LTER) National Communications Office (LNCO), NSF grant #1545288 to F. Davis, M. Schildhauer, S. Rebich Hespanha, J. Caselle and C. Blanchette

Thanks also go to NCEAS computing team members Mark Schildhauer, Peter Slaughter, Dominic Muellen, Steven Chong, Jesse Goldstein and Matt Jones for their inputs on this package.

-

NCEAS logo

+
+NCEAS logo
NCEAS logo
+
@@ -169,28 +196,46 @@

-
- +

- - + + diff --git a/docs/reference/download_d1_data.html b/docs/reference/download_d1_data.html index 2d81e7a..65ff01a 100644 --- a/docs/reference/download_d1_data.html +++ b/docs/reference/download_d1_data.html @@ -1,67 +1,12 @@ - - - - - - - -Download data and metadata from DataONE — download_d1_data • metajam - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Download data and metadata from DataONE — download_d1_data • metajam - + + - - - -
-
- -
- -
+
@@ -140,70 +79,63 @@

Download data and metadata from DataONE

Downloads a data object from DataONE along with metadata.

-
download_d1_data(data_url, path, dir_name = NULL)
- -

Arguments

- - - - - - - - - - - - - - -
data_url

(character) An identifier or URL for a DataONE object to download.

path

(character) Path to a directory to download data to.

dir_name

(character) (Optional) Desired name for the folder containing the downloaded data. Defaults to the data file name.

- -

Value

- -

(character) Path where data is downloaded to.

-

See also

- - - -

Examples

-
if (FALSE) { -soi_moist_path <- download_d1_data( - data_url = "urn:uuid:a2834e3e-f453-4c2b-8343-99477662b570", - path = tempdir()) -download_d1_data( - data_url = "https://cn.dataone.org/cn/v2/resolve/urn:uuid:a2834e3e-f453-4c2b-8343-99477662b570", - path = tempdir(), - dir_name = "test" - ) -} - -
+
+
download_d1_data(data_url, path)
+
+ +
+

Arguments

+
data_url
+

(character) An identifier or URL for a DataONE object to download.

+ + +
path
+

(character) Path to a directory to download data to.

+ +
+
+

Value

+ + +

(character) Path where data is downloaded to.

+
+ + +
+

Examples

+
if (FALSE) {
+download_d1_data("urn:uuid:a2834e3e-f453-4c2b-8343-99477662b570", path = "./Data")
+download_d1_data(
+   "https://cn.dataone.org/cn/v2/resolve/urn:uuid:a2834e3e-f453-4c2b-8343-99477662b570",
+    path = "."
+    )
+}
+
+
+
-
- +
- - + + diff --git a/docs/reference/download_d1_data_pkg.html b/docs/reference/download_d1_data_pkg.html index 75b5cb7..88592f6 100644 --- a/docs/reference/download_d1_data_pkg.html +++ b/docs/reference/download_d1_data_pkg.html @@ -1,67 +1,12 @@ - - - - - - - -Download all data and metadata of a data package from DataONE — download_d1_data_pkg • metajam - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Download all data and metadata of a data package from DataONE — download_d1_data_pkg • metajam - + + - - - -
-
- -
- -
+
@@ -140,59 +79,60 @@

Download all data and metadata of a data package from DataONE

Downloads all the data objects of a data package from DataONE along with metadata.

-
download_d1_data_pkg(meta_obj, path)
- -

Arguments

- - - - - - - - - - -
meta_obj

(character) A DOI or metadata object PID for a DataONE package to download.

path

(character) Path to a directory to download data to.

- -

Value

- -

(list) Paths where data are downloaded to.

-

See also

- - - -

Examples

-
if (FALSE) { -download_d1_data_pkg("doi:10.18739/A2028W", ".") -download_d1_data_pkg("https://doi.org/10.18739/A2028W", ".") -} -
+
+
download_d1_data_pkg(meta_obj, path)
+
+ +
+

Arguments

+
meta_obj
+

(character) A DOI or metadata object PID for a DataONE package to download.

+ + +
path
+

(character) Path to a directory to download data to.

+ +
+
+

Value

+ + +

(list) Paths where data are downloaded to.

+
+ + +
+

Examples

+
if (FALSE) {
+download_d1_data_pkg("doi:10.18739/A2028W", ".")
+download_d1_data_pkg("https://doi.org/10.18739/A2028W", ".")
+}
+
+
+
-
- +
- - + + diff --git a/docs/reference/index.html b/docs/reference/index.html index 5ebcd0e..dcf58cf 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,66 +1,12 @@ - - - - - - - -Function reference • metajam - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Function reference • metajam - - + + - - -
-
- -
- -
+
- - - - - - - - - - - + + +
-

Download functions

+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - -
+

Download functions

+

download_d1_data()

Download data and metadata from DataONE

+

download_d1_data_pkg()

Download all data and metadata of a data package from DataONE

+

check_version()

Check PID version

-

Read functions

+
+

Read functions

+

read_d1_files()

Read data and metadata based on download_d1_data() file structure

-

Parse metadata

+

Read data and metadata based on download_d1_data() file structure

+

Parse metadata

+

tabularize_eml()

Get tabular metadata

- +
+

metajam

+

+
+

metajam

+

metajam package

+
-
- +
- - + + diff --git a/docs/reference/metajam.html b/docs/reference/metajam.html index 7ad6ad9..d34e1b0 100644 --- a/docs/reference/metajam.html +++ b/docs/reference/metajam.html @@ -1,67 +1,12 @@ - - - - - - - -metajam package — metajam • metajam - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -metajam package — metajam • metajam - + + - - - -
-
- -
- -
+
@@ -141,36 +80,32 @@

metajam package

- -

Details

- -

See GitHub

+
+

Details

+

See GitHub

+
+
-
- +
- - + + diff --git a/docs/reference/read_d1_files.html b/docs/reference/read_d1_files.html index f958a8d..1a39d1f 100644 --- a/docs/reference/read_d1_files.html +++ b/docs/reference/read_d1_files.html @@ -1,67 +1,12 @@ - - - - - - - -Read data and metadata based on download_d1_data() file structure — read_d1_files • metajam - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Read data and metadata based on download_d1_data() file structure — read_d1_files • metajam - - + + - - -
-
- -
- -
+
-

Reads data along with metadata into your R environment based on download_d1_data() file structure.

+

Reads data along with metadata into your R environment based on download_d1_data() file structure.

+
+ +
+
read_d1_files(folder_path, fnc = "read_csv", ...)
+
+ +
+

Arguments

+
folder_path
+

(character) Path to a directory where data and metadata are located.

+ + +
fnc
+

(character) Function to be used to read the data (default is readr::read_csv()).

+ + +
...
+

Parameters to pass into the function specified in fnc.

+ +
+
+

Value

+ + +

(list) Named list containing data and metadata as data frames.

+
+ -
read_d1_files(folder_path, fnc = "read_csv", ...)
- -

Arguments

- - - - - - - - - - - - - - -
folder_path

(character) Path to a directory where data and metadata are located.

fnc

(character) Function to be used to read the data (default is readr::read_csv()).

...

Parameters to pass into the function specified in fnc.

- -

Value

- -

(list) Named list containing data and metadata as data frames.

-

See also

- - - -

Examples

-
data_folder <- system.file("extdata", "test_data", package = "metajam") -soil_moist_data <- read_d1_files(data_folder) -
#> Parsed with column specification: -#> cols( -#> attributeName = col_character(), -#> attributeDefinition = col_character(), -#> formatString = col_character(), -#> measurementScale = col_character(), -#> unit = col_character(), -#> numberType = col_character(), -#> missingValueCode = col_character(), -#> missingValueCodeExplanation = col_character(), -#> domain = col_character() -#> )
#> Parsed with column specification: -#> cols( -#> name = col_character(), -#> value = col_character() -#> )
#> Parsed with column specification: -#> cols( -#> Date = col_character(), -#> `Unmanipulated Moisture (cm3 cm-3)` = col_double(), -#> `Unmanipulated Moisure (SE)` = col_double(), -#> `Unburned Moisture (cm3 cm-3)` = col_double(), -#> `Unburned Moisture (SE)` = col_double(), -#> `Low Severity Moisture (cm3 cm-3)` = col_double(), -#> `Low Severity Moisture (SE)` = col_double(), -#> `Moderate Severity Moisture (cm3 cm-3)` = col_double(), -#> `Moderate Severity Moisture (SE)` = col_double(), -#> `High Severity Moisture (cm3 cm-3)` = col_double(), -#> `High Severity Moisture (SE)` = col_double() -#> )
-# You can specify the function you would like to use to read the file and pass parameters -soil_moist_data_skipped <- read_d1_files(data_folder, "read.csv", - skip = 8, stringsAsFactors = FALSE) -
#> Parsed with column specification: -#> cols( -#> attributeName = col_character(), -#> attributeDefinition = col_character(), -#> formatString = col_character(), -#> measurementScale = col_character(), -#> unit = col_character(), -#> numberType = col_character(), -#> missingValueCode = col_character(), -#> missingValueCodeExplanation = col_character(), -#> domain = col_character() -#> )
#> Parsed with column specification: -#> cols( -#> name = col_character(), -#> value = col_character() -#> )
+
+

Examples

+
data_folder <- system.file("extdata", "test_data", package = "metajam")
+soil_moist_data <- read_d1_files(data_folder)
+#> Rows: 21 Columns: 11
+#> ── Column specification ────────────────────────────────────────────────────────
+#> Delimiter: ","
+#> chr  (1): Date
+#> dbl (10): Unmanipulated Moisture (cm3 cm-3), Unmanipulated Moisure (SE), Unb...
+#> 
+#>  Use `spec()` to retrieve the full column specification for this data.
+#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
+#> Rows: 11 Columns: 9
+#> ── Column specification ────────────────────────────────────────────────────────
+#> Delimiter: ","
+#> chr (9): attributeName, attributeDefinition, formatString, measurementScale,...
+#> 
+#>  Use `spec()` to retrieve the full column specification for this data.
+#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
+#> Rows: 17 Columns: 2
+#> ── Column specification ────────────────────────────────────────────────────────
+#> Delimiter: ","
+#> chr (2): name, value
+#> 
+#>  Use `spec()` to retrieve the full column specification for this data.
+#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
+
+# You can specify the function you would like to use to read the file and pass parameters
+soil_moist_data_skipped <- read_d1_files(data_folder, "read.csv",
+                                         skip = 8, stringsAsFactors = FALSE)
+#> Rows: 11 Columns: 9
+#> ── Column specification ────────────────────────────────────────────────────────
+#> Delimiter: ","
+#> chr (9): attributeName, attributeDefinition, formatString, measurementScale,...
+#> 
+#>  Use `spec()` to retrieve the full column specification for this data.
+#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
+#> Rows: 17 Columns: 2
+#> ── Column specification ────────────────────────────────────────────────────────
+#> Delimiter: ","
+#> chr (2): name, value
+#> 
+#>  Use `spec()` to retrieve the full column specification for this data.
+#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
+
+
+
-
- +
- - + + diff --git a/docs/reference/tabularize_eml.html b/docs/reference/tabularize_eml.html index 4bf7629..3e52159 100644 --- a/docs/reference/tabularize_eml.html +++ b/docs/reference/tabularize_eml.html @@ -1,67 +1,12 @@ - - - - - - - -Get tabular metadata — tabularize_eml • metajam - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Get tabular metadata — tabularize_eml • metajam + + - - - - -
-
- -
- -
+
@@ -140,88 +79,75 @@

Get tabular metadata

This function takes a path to an EML (.xml) metadata file and returns a data frame.

-
tabularize_eml(eml, full = FALSE)
- -

Arguments

- - - - - - - - - - -
eml

An emld class object, the path to an EML (.xml) metadata file, or a raw EML object.

full

(logical) Returns the most commonly used metadata fields by default. -If full = TRUE is specified, the full set of metadata fields are returned.

- -

Value

- -

(data.frame) A data frame of selected EML values.

- -

Examples

-
eml <- system.file("extdata", "test_data", "SoilMois2012_2017__full_metadata.xml", - package = "metajam") - tabularize_eml(eml) -
#> # A tibble: 16 x 2 -#> name value -#> <chr> <chr> -#> 1 abstract Fire severity is increasing across the boreal f… -#> 2 eml.version eml://ecoinformatics.org/eml-2.1.1 eml.xsd -#> 3 geographicCoverage.eastBoun… 161.4067 -#> 4 geographicCoverage.geograph… Far northeastern Siberia near Cherskiy, Russia -#> 5 geographicCoverage.northBou… 68.7433 -#> 6 geographicCoverage.southBou… 68.7433 -#> 7 geographicCoverage.westBoun… 161.4067 -#> 8 keyword None; fire; permafrost; Siberia; Larch; Larix -#> 9 methods <title>Surface soil moisture</title><para>From … -#> 10 objectName Alexander_Exp Burn Soil Mois 2012_2017.csv; Ale… -#> 11 people Alexander; Heather; D.; Michael; Loranty; Miche… -#> 12 taxonomicCoverage Larix cajanderi -#> 13 temporalCoverage.beginDate 2012-07-01 -#> 14 temporalCoverage.endDate 2017-08-01 -#> 15 title Surface soil moisture across an experimental bu… -#> 16 url download; https://cn.dataone.org/cn/v2/resolve/…
tabularize_eml(eml, full = TRUE) -
#> # A tibble: 189 x 2 -#> name value -#> <chr> <chr> -#> 1 @context.@vocab https://eml.ecoinformatics.org/eml… -#> 2 @context.eml https://eml.ecoinformatics.org/eml… -#> 3 @context.xsi http://www.w3.org/2001/XMLSchema-i… -#> 4 @context.xml http://www.w3.org/XML/1998/namespa… -#> 5 @context.stmml http://www.xml-cml.org/schema/stmm… -#> 6 @context.id @id -#> 7 @context.@base eml:// -#> 8 @type EML -#> 9 additionalMetadata.metadata.unitList.xml… eml://ecoinformatics.org/eml-2.1.1 -#> 10 additionalMetadata.metadata.unitList.xml… http://www.xml-cml.org/schema/stmm… -#> # … with 179 more rows
+
+
tabularize_eml(eml, full = FALSE)
+
+ +
+

Arguments

+
eml
+

An emld class object, the path to an EML (.xml) metadata file, or a raw EML object.

+ + +
full
+

(logical) Returns the most commonly used metadata fields by default. +If full = TRUE is specified, the full set of metadata fields are returned.

+ +
+
+

Value

+ + +

(data.frame) A data frame of selected EML values.

+
+ +
+

Examples

+
   eml <- system.file("extdata", "test_data", "SoilMois2012_2017__full_metadata.xml",
+                  package = "metajam")
+   tabularize_eml(eml)
+#> # A tibble: 16 × 2
+#>    name                                       value                             
+#>    <chr>                                      <chr>                             
+#>  1 abstract                                   Fire severity is increasing acros…
+#>  2 eml.version                                eml://ecoinformatics.org/eml-2.1.…
+#>  3 geographicCoverage.eastBoundingCoordinate  161.4067                          
+#>  4 geographicCoverage.geographicDescription   Far northeastern Siberia near Che…
+#>  5 geographicCoverage.northBoundingCoordinate 68.7433                           
+#>  6 geographicCoverage.southBoundingCoordinate 68.7433                           
+#>  7 geographicCoverage.westBoundingCoordinate  161.4067                          
+#>  8 keyword                                    None; fire; permafrost; Siberia; …
+#>  9 methods                                    <title>Surface soil moisture</tit…
+#> 10 objectName                                 Alexander_Exp Burn Soil Mois 2012…
+#> 11 people                                     Alexander; Heather; D.; Michael; …
+#> 12 taxonomicCoverage                          Larix cajanderi                   
+#> 13 temporalCoverage.beginDate                 2012-07-01                        
+#> 14 temporalCoverage.endDate                   2017-08-01                        
+#> 15 title                                      Surface soil moisture across an e…
+#> 16 url                                        download; https://cn.dataone.org/…
+
+
+
-
- +
- - + + diff --git a/vignettes/dataset-single-DataOne.Rmd b/vignettes/dataset-single-DataOne.Rmd index 9c00df3..5dbc6d2 100644 --- a/vignettes/dataset-single-DataOne.Rmd +++ b/vignettes/dataset-single-DataOne.Rmd @@ -14,9 +14,6 @@ knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) - -# Ignore difference in YAML title versus `\VignetteIndexEntry{}` -options(rmarkdown.html_vignette.check_title = FALSE) ``` ## Summary From 4f02281e8f04657cd1a78ce600a923764bded4a3 Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 14:58:03 -0400 Subject: [PATCH 16/77] First pass at updating R-CMD check GitHub action YAML --- .github/workflows/R-CMD-check.yaml | 54 +++++++++++++++++++----------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 6d2df6f..6cdf2c0 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -2,34 +2,48 @@ # https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions on: push: - branches: - - dev - - main + branches: [main, master] pull_request: - branches: - - dev - - main + branches: [main, master] name: R-CMD-check jobs: R-CMD-check: - runs-on: macOS-latest + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + steps: - - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-pandoc@v1 - - uses: r-lib/actions/setup-r@v1 + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} use-public-rspm: true - - name: Install udunits - run: brew install udunits - - name: Install dependencies - run: | - install.packages(c("remotes", "rcmdcheck")) - remotes::install_deps(dependencies = TRUE) - shell: Rscript {0} - - name: Check - run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error") - shell: Rscript {0} + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true From f29e1fe7b723b917cf361976c307fb64124f64b0 Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 15:05:53 -0400 Subject: [PATCH 17/77] Experimenting with GitHub action for pkgdown build on PR (if works, can then test without needing to merge PR first) --- .github/workflows/pkgdown.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index b383633..c44b634 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -3,6 +3,8 @@ on: push: branches: [main, master] + pull_request: + branches: [main, master] release: types: [published] workflow_dispatch: From d071be4d6913f5abbd292a8bb6cf1b10e031bc45 Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 15:09:14 -0400 Subject: [PATCH 18/77] Attempting update of pkgdown site built GitHub action --- .github/workflows/pkgdown.yaml | 36 +++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index c44b634..a7276e8 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -1,4 +1,4 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: @@ -14,27 +14,35 @@ name: pkgdown jobs: pkgdown: runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - uses: r-lib/actions/setup-pandoc@v1 + - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - - name: Install udunit2 - run: sudo apt-get install libudunits2-dev - - - uses: r-lib/actions/setup-r-dependencies@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: pkgdown + extra-packages: any::pkgdown, local::. needs: website - - name: Deploy package - run: | - git config --local user.name "$GITHUB_ACTOR" - git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" - Rscript -e 'pkgdown::deploy_to_branch(github_pages = (branch == "gh-pages"), new_process = FALSE)' + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: docs From e80aaff11b03612b5f21cb475f866e0e1c14e514 Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 15:14:28 -0400 Subject: [PATCH 19/77] Tweaking dependency location for pkgdown build --- .github/workflows/pkgdown.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index a7276e8..59a2628 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -30,7 +30,7 @@ jobs: with: use-public-rspm: true - - uses: r-lib/actions/setup-r-dependencies@v2 + - uses: r-lib/actions/setup-renv@v2 with: extra-packages: any::pkgdown, local::. needs: website From 00b34da5daf5b05ebf25530418070a25b6adcb2a Mon Sep 17 00:00:00 2001 From: njlyon0 Date: Thu, 21 Mar 2024 15:20:04 -0400 Subject: [PATCH 20/77] Deleting existing pkgdown docs / GitHub action to try a clean reset on that --- .github/workflows/pkgdown.yaml | 48 -- docs/404.html | 132 ----- docs/LICENSE-text.html | 305 ------------ docs/articles/dataset-batch-processing.html | 454 ------------------ .../empty-anchor.js | 15 - .../header-attrs-2.2/header-attrs.js | 12 - .../header-attrs-2.3/header-attrs.js | 12 - docs/articles/dataset-single.html | 238 --------- .../empty-anchor.js | 15 - .../header-attrs-2.2/header-attrs.js | 12 - .../header-attrs-2.3/header-attrs.js | 12 - docs/articles/index.html | 123 ----- docs/articles/package-download.html | 186 ------- .../empty-anchor.js | 15 - .../header-attrs-2.2/header-attrs.js | 12 - .../header-attrs-2.3/header-attrs.js | 12 - docs/articles/reading-raster.html | 230 --------- .../empty-anchor.js | 15 - .../figure-html/read_raster-1.png | Bin 205490 -> 0 bytes .../header-attrs-2.2/header-attrs.js | 12 - .../header-attrs-2.3/header-attrs.js | 12 - docs/authors.html | 155 ------ docs/bootstrap-toc.css | 60 --- docs/bootstrap-toc.js | 159 ------ docs/docsearch.css | 148 ------ docs/docsearch.js | 85 ---- docs/favicon.ico | Bin 1408 -> 0 bytes docs/index.html | 265 ---------- docs/inst/images/copy-link.png | Bin 283483 -> 0 bytes docs/inst/images/download-output.png | Bin 123474 -> 0 bytes docs/inst/images/file-output.png | Bin 59880 -> 0 bytes docs/inst/images/metajam_hex.png | Bin 62956 -> 0 bytes docs/inst/images/metajam_v1_folder.png | Bin 59902 -> 0 bytes docs/inst/images/metajam_v1_named_list.png | Bin 75816 -> 0 bytes docs/inst/images/read-output.png | Bin 66634 -> 0 bytes docs/inst/images/shipping-metadata.png | Bin 490886 -> 0 bytes docs/inst/images/shipping-raster.png | Bin 453639 -> 0 bytes docs/link.svg | 12 - docs/pkgdown.css | 384 --------------- docs/pkgdown.js | 108 ----- docs/pkgdown.yml | 14 - docs/reference/Rplot001.png | Bin 1011 -> 0 bytes docs/reference/check_version.html | 147 ------ docs/reference/download_d1_data.html | 141 ------ docs/reference/download_d1_data_pkg.html | 138 ------ docs/reference/get_pkg_pids.html | 175 ------- docs/reference/index.html | 140 ------ docs/reference/metajam.html | 111 ----- docs/reference/read_d1_files.html | 180 ------- docs/reference/tabularize_eml.html | 153 ------ 50 files changed, 4447 deletions(-) delete mode 100644 .github/workflows/pkgdown.yaml delete mode 100644 docs/404.html delete mode 100644 docs/LICENSE-text.html delete mode 100644 docs/articles/dataset-batch-processing.html delete mode 100644 docs/articles/dataset-batch-processing_files/accessible-code-block-0.0.1/empty-anchor.js delete mode 100644 docs/articles/dataset-batch-processing_files/header-attrs-2.2/header-attrs.js delete mode 100644 docs/articles/dataset-batch-processing_files/header-attrs-2.3/header-attrs.js delete mode 100644 docs/articles/dataset-single.html delete mode 100644 docs/articles/dataset-single_files/accessible-code-block-0.0.1/empty-anchor.js delete mode 100644 docs/articles/dataset-single_files/header-attrs-2.2/header-attrs.js delete mode 100644 docs/articles/dataset-single_files/header-attrs-2.3/header-attrs.js delete mode 100644 docs/articles/index.html delete mode 100644 docs/articles/package-download.html delete mode 100644 docs/articles/package-download_files/accessible-code-block-0.0.1/empty-anchor.js delete mode 100644 docs/articles/package-download_files/header-attrs-2.2/header-attrs.js delete mode 100644 docs/articles/package-download_files/header-attrs-2.3/header-attrs.js delete mode 100644 docs/articles/reading-raster.html delete mode 100644 docs/articles/reading-raster_files/accessible-code-block-0.0.1/empty-anchor.js delete mode 100644 docs/articles/reading-raster_files/figure-html/read_raster-1.png delete mode 100644 docs/articles/reading-raster_files/header-attrs-2.2/header-attrs.js delete mode 100644 docs/articles/reading-raster_files/header-attrs-2.3/header-attrs.js delete mode 100644 docs/authors.html delete mode 100644 docs/bootstrap-toc.css delete mode 100644 docs/bootstrap-toc.js delete mode 100644 docs/docsearch.css delete mode 100644 docs/docsearch.js delete mode 100644 docs/favicon.ico delete mode 100644 docs/index.html delete mode 100644 docs/inst/images/copy-link.png delete mode 100644 docs/inst/images/download-output.png delete mode 100644 docs/inst/images/file-output.png delete mode 100644 docs/inst/images/metajam_hex.png delete mode 100644 docs/inst/images/metajam_v1_folder.png delete mode 100644 docs/inst/images/metajam_v1_named_list.png delete mode 100644 docs/inst/images/read-output.png delete mode 100644 docs/inst/images/shipping-metadata.png delete mode 100644 docs/inst/images/shipping-raster.png delete mode 100644 docs/link.svg delete mode 100644 docs/pkgdown.css delete mode 100644 docs/pkgdown.js delete mode 100644 docs/pkgdown.yml delete mode 100644 docs/reference/Rplot001.png delete mode 100644 docs/reference/check_version.html delete mode 100644 docs/reference/download_d1_data.html delete mode 100644 docs/reference/download_d1_data_pkg.html delete mode 100644 docs/reference/get_pkg_pids.html delete mode 100644 docs/reference/index.html delete mode 100644 docs/reference/metajam.html delete mode 100644 docs/reference/read_d1_files.html delete mode 100644 docs/reference/tabularize_eml.html diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml deleted file mode 100644 index 59a2628..0000000 --- a/.github/workflows/pkgdown.yaml +++ /dev/null @@ -1,48 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - release: - types: [published] - workflow_dispatch: - -name: pkgdown - -jobs: - pkgdown: - runs-on: ubuntu-latest - # Only restrict concurrency for non-PR jobs - concurrency: - group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - permissions: - contents: write - steps: - - uses: actions/checkout@v4 - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-renv@v2 - with: - extra-packages: any::pkgdown, local::. - needs: website - - - name: Build site - run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) - shell: Rscript {0} - - - name: Deploy to GitHub pages 🚀 - if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4.5.0 - with: - clean: false - branch: gh-pages - folder: docs diff --git a/docs/404.html b/docs/404.html deleted file mode 100644 index c58a0e5..0000000 --- a/docs/404.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - -Page not found (404) • metajam - - - - - - - - - - - -
-
- - - - -
-
- - -Content not found. Please use links in the navbar. - -
- - - -
- - - -
- -
-

-

Site built with pkgdown 2.0.7.

-
- -
-
- - - - - - - - diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html deleted file mode 100644 index 10a76f4..0000000 --- a/docs/LICENSE-text.html +++ /dev/null @@ -1,305 +0,0 @@ - -License • metajam - - -
-
- - - -
-
- - -
                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [2018] [Regents of the University of California]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-
- -
- - - -
- - - -
- -
-

Site built with pkgdown 2.0.7.

-
- -
- - - - - - - - diff --git a/docs/articles/dataset-batch-processing.html b/docs/articles/dataset-batch-processing.html deleted file mode 100644 index 6cde777..0000000 --- a/docs/articles/dataset-batch-processing.html +++ /dev/null @@ -1,454 +0,0 @@ - - - - - - - -Use Case 2 - Processing stream chemistry data for the LTER Luquillo site • metajam - - - - - - - - - - - - -
-
- - - - -
-
- - - - -
-

Summary -

-

This vignette aims to showcase a use case using the 2 main functions -of metajam - download_d1_data and -read_d1_files using a data processing workflow developed by -the NCO synthesis working group Stream -Elemental Cycling.

-

The datasets used are from the LTER -site - Luquillo and can be found in the PASTA data repository http://dx.doi.org/doi:10.6073/pasta/f9df56348f510da0113b1e6012fa2967. -This data package is a collection of 8 datasets of stream water samples -from 8 different locations of the Luquillo Mountains.

-

Our goal is to read the data for the 8 different -sampling sites and aggregate them into one harmonized dataset. We will -use the metadata to check if the data structures and units are the same -across the 8 different sampling sites before performing the -aggregation.

-
-
-

Libraries -

-
-#devtools::install_github("NCEAS/metajam")
-library(metajam)  
-library(udunits2)
-
-# For wrangling the data
-library(readr)
-library(tidyr)
-library(dplyr)
-library(purrr)
-library(stringr)
-
-
-

Constants -

-
-# Download the data from DataONE on your local machine
-data_folder <- "Data_SEC"
-
-# Ammonium to Ammoniacal-nitrogen conversion. We will use this conversion later.
-coeff_conv_NH4_to_NH4N <- 0.7764676534
-
-
-

Download the datasets -

-
-# Create the local directory to store datasets
-dir.create(data_folder, showWarnings = FALSE)
-
-# Get the datasets unique identifiers
-test_datasets_listing <- read_csv(system.file("extdata", "LTER-SEC_DatasetsListing_SearchedData.csv", package = "metajam"))
-
-# Keep only the LUQ related datasets
-luq_test_datasets <- test_datasets_listing %>%
-  filter(grepl("LUQ", .$`LTER site abbreviation`)) %>%
-  select(`LTER site abbreviation`,
-         `Data Repository (PASTA) URL to Archive/Metadata`,
-         `Data Repository (PASTA) URL to File`,
-         `Data Repository (PASTA) Filename`) %>%
-  na.omit() %>%
-  arrange(`Data Repository (PASTA) Filename`) # sort the data sets alphabetically
-
-## Batch download the datasets
-
-# the tidiest way
-local_datasets <- map(luq_test_datasets$`Data Repository (PASTA) URL to File`, ~download_d1_data(.x, data_folder))
-
-# the apply way
-# local_datasets <- lapply(luq_test_datasets$`Data Repository (PASTA) URL to File`, download_d1_data, data_folder)
-
-# the map way
-# local_datasets <- map(luq_test_datasets$`Data Repository (PASTA) URL to File`, function(x) {download_d1_data(x, data_folder)})
-

At this point, you should have all the data and the metadata -downloaded inside your main directory; Data_SEC in this -example. metajam organize the files as follow:

-
    -
  • Each dataset is stored a sub-directory named after the package DOI -and the file name
  • -
  • Inside this sub-directory, you will find -
      -
    • the data: my_data.csv -
    • -
    • the raw EML with the naming convention file name + -__full_metadata.xml: -my_data__full_metadata.xml -
    • -
    • the package level metadata summary with the naming convention -file name + __summary_metadata.csv: -my_data__summary_metadata.csv -
    • -
    • If relevant, the attribute level metadata with the naming convention -file name + __attribute_metadata.csv: -my_data__attribute_metadata.csv -
    • -
    • If relevant, the factor level metadata with the naming convention -file name + __attribute_factor_metadata.csv: -my_data__attribute_factor_metadata.csv -
    • -
    -
  • -
-
-
-

Read the data and metadata in your R environment -

-
-# You could list the datasets dowloaded in the `Data_SEC` folder 
-# local_datasets <- dir(data_folder, full.names = TRUE)
-
-# or you can directly use the outputed paths from download_d1_data 
-# Read all the datasets and their associated metadata in as a named list
-luq_datasets <- map(local_datasets, read_d1_files) %>% 
-  set_names(map(., ~.x$summary_metadata$value[.x$summary_metadata$name == "File_Name"]))
-
-
-

Perform checks on data structure -

-

Is the data structure the same across sampling sites (datasets)? For -example, do the datasets all have the same column names?

-
-# list all the attributes
-attributes_luq <- luq_datasets %>% map("data") %>% map(colnames)
-
-# Check if they are identical by comparing all against the first site
-for(ds in names(attributes_luq)) {
-  print(identical(attributes_luq[[1]], attributes_luq[[ds]]))
-}
-
-#> => We are good, same data structure across the sampling sites
-
-

Conclusion -

-
    -
  • the same attributes are reported at the different sampling -sites
  • -
-
-
-
-

Perform checks on the units -

-

Is data reported in identical units? For example, in every dataset is -CI reported in microgramsPerLiter?

-
-# List all the units used
-luq_units <- luq_datasets %>% map("attribute_metadata") %>% map(~.[["unit"]])
-
-# Check if they are identical by comparing all against the first site
-for(us in names(luq_units)) {
-  print(identical(luq_units[[1]], luq_units[[us]]))
-}
-
-#>!!! => The 2 last datasets have different units!!!!!!!!!!
-
-# Let's check the differences
-luq_units_merged <- luq_datasets %>%
-  map("attribute_metadata") %>%
-  map(. %>% select(attributeName, unit)) %>%
-  reduce(full_join, by = "attributeName") 
-
-## Rename
-# Create the new names
-luq_new_colnames <- names(luq_units) %>%
-  str_split("[.]") %>%
-  map(~.[1]) %>%
-  paste("unit", ., sep = "_")
-
-# Apply the new names
-colnames(luq_units_merged) <- c("attributeName", luq_new_colnames)
-
-

Conclusion -

-
    -
  • For the 2 last sampling sites RioIcacos and -RioMameyesPuenteRoto, the units used for the gage height -(“Gage_Ht”) are in feet and not meters like the other sites
  • -
  • For the 2 last sampling sites RioIcacos and -RioMameyesPuenteRoto, NH4 and not -NH4-N is measured
  • -
-
-
-
-

Fixing units discrepancies -

-
-# fix attribute naming discrepancies -- to be improved 
-# Copy the units for Gage height
-luq_units_merged <- luq_units_merged %>% 
-  mutate(unit_RioIcacos = ifelse(attributeName == "Gage_Ht", "foot", unit_RioIcacos),
-         unit_RioMameyesPuenteRoto = ifelse(attributeName == "Gage_Ht", "foot", unit_RioMameyesPuenteRoto))
-
-
-# Copy the units for NH4
-luq_units_merged <- luq_units_merged %>% 
-  mutate(unit_RioIcacos = ifelse(attributeName == "NH4-N", "microgramsPerLiter", unit_RioIcacos),
-         unit_RioMameyesPuenteRoto = ifelse(attributeName == "NH4-N", "microgramsPerLiter", unit_RioMameyesPuenteRoto))
-
-
-# drop the 2 last rows
-luq_units_merged <- head(luq_units_merged, -2)
-
-
-### Implement the unit conversion for RioIcacos and RioMameyesPuenteRoto ----
-
-# Simplify naming
-RioIcacos_data <- luq_datasets$RioIcacos$data
-RioIcacos_attrmeta <- luq_datasets$RioIcacos$attribute_metadata
-
-
-## RioIcacos
-# Fix NAs. In this dataset "-9999" is the missing value code. So we need to replace those with NAs
-RioIcacos_data <- na_if(RioIcacos_data, "-9999")
-
-# Do the unit conversion  
-
-#Check to see if you can use the udunits package to convert feet to meters
-
-ud.are.convertible("foot", "meter")
-
-#TRUE, so we can use udunits to do the conversion
-
-# Do the unit conversion in both the data file and the attributes file  - Gage height - udunits way
-
-RioIcacos_data$Gage_Ht <- ud.convert(RioIcacos_data$Gage_Ht, "foot", "meter")
-
-RioIcacos_attrmeta$unit <-  str_replace_all(RioIcacos_attrmeta$unit, pattern = "foot", replacement = "meter")
-
-
-# If we could NOT use udunits to do the conversion we could do it manually this way 
-
-#RioIcacos_data <- RioIcacos_data %>% mutate( `Gage_Ht` = `Gage_Ht`* 0.3048)
-
-# Do the unit conversion for RioIcacos and RioMameyesPuenteRoto - NH4 to NH4-N
-
-#Check to see if you can use udunits to convert the measurements you want to convert.
-
-ud.are.convertible("NH4", "NH4-N")
-
-#FALSE = Udunits cannot convert these units for us so we will manually convert using the input below
-
-# Ammonium to Ammoniacal-nitrogen conversion
-coeff_conv_NH4_to_NH4N <- 0.7764676534
-
-
-# Unit conversion for RioIcacos and RioMameyesPuenteRoto - NH4 to NH4-N
-RioIcacos_data <- RioIcacos_data %>% mutate( `NH4-N` = `NH4-N`* coeff_conv_NH4_to_NH4N)
-
-
-# Update the main object 
-luq_datasets$RioIcacos$data <- RioIcacos_data
-
-
-## RioMameyesPuenteRoto
-
-# Simplify naming
-RioMameyesPuenteRoto_data <- luq_datasets$RioMameyesPuenteRoto$data
-RioMameyesPuenteRoto_attrmeta <- luq_datasets$RioMameyesPuenteRoto$attribute_metadata
-
-#Replace all cells with the missing value code ("-9999") with "NA"
-RioMameyesPuenteRoto_data <- na_if(RioMameyesPuenteRoto_data, "-9999")
-
-#Tidy version of unit conversion 
-
-RioMameyesPuenteRoto_data$Gage_Ht <- ud.convert(RioMameyesPuenteRoto_data$Gage_Ht, "foot", "meter")
-RioMameyesPuenteRoto_attrmeta$unit <-  str_replace_all (RioMameyesPuenteRoto_attrmeta$unit, pattern = "foot", replacement = "meter")
-
-# Do the unit conversion for RioMameyesPuenteRoto - NH4 to NH4-N (recall that we cannot use udunits for this so we are doing it manually)
-
-#In this dataset the NH4-N column is actually empty, so this is not necessary. But here is how you would do it if you had to.
-
-
-RioMameyesPuenteRoto_data <- RioMameyesPuenteRoto_data %>% mutate( `NH4-N` = `NH4-N`* coeff_conv_NH4_to_NH4N)
-
-# Update the main object
-luq_datasets$RioMameyesPuenteRoto$data <- RioMameyesPuenteRoto_data 
-
-                                                
-
-
-

Append all the sampling sites into one master dataset -

-
-# bind the sampling sites data into one master dataset for LUQ
-all_sites_luq <- luq_datasets %>%
-  map("data") %>% 
-  bind_rows(.id = "prov")
-
-# Replace -9999 with NAs
-all_sites_luq <- na_if(all_sites_luq, "-9999")
-
-# Write as csv
-write_csv(all_sites_luq, "stream_chem_all_LUQ.csv")
-
-
-

General Conclusion -

-
    -
  • Although the column names were the same in all the datasets / -sampling sites, looking at the metadata we discovered that 2 sampling -sites are measuring stream gage height and NH4 concentration using -different protocols.
  • -
  • We used the metadata to perform the necessary unit conversions to -homogenize the 8 datasets before merging them into one master -dataset.
  • -
  • During the merge process, we added a provenance column to be able to -track the origin of each row, allowing users of the master datasets to -check the original datasets metadata when necessary.
  • -
-
-
- - - -
- - - -
- -
-

-

Site built with pkgdown 2.0.7.

-
- -
-
- - - - - - - - diff --git a/docs/articles/dataset-batch-processing_files/accessible-code-block-0.0.1/empty-anchor.js b/docs/articles/dataset-batch-processing_files/accessible-code-block-0.0.1/empty-anchor.js deleted file mode 100644 index ca349fd..0000000 --- a/docs/articles/dataset-batch-processing_files/accessible-code-block-0.0.1/empty-anchor.js +++ /dev/null @@ -1,15 +0,0 @@ -// Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> -// v0.0.1 -// Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. - -document.addEventListener('DOMContentLoaded', function() { - const codeList = document.getElementsByClassName("sourceCode"); - for (var i = 0; i < codeList.length; i++) { - var linkList = codeList[i].getElementsByTagName('a'); - for (var j = 0; j < linkList.length; j++) { - if (linkList[j].innerHTML === "") { - linkList[j].setAttribute('aria-hidden', 'true'); - } - } - } -}); diff --git a/docs/articles/dataset-batch-processing_files/header-attrs-2.2/header-attrs.js b/docs/articles/dataset-batch-processing_files/header-attrs-2.2/header-attrs.js deleted file mode 100644 index dd57d92..0000000 --- a/docs/articles/dataset-batch-processing_files/header-attrs-2.2/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/dataset-batch-processing_files/header-attrs-2.3/header-attrs.js b/docs/articles/dataset-batch-processing_files/header-attrs-2.3/header-attrs.js deleted file mode 100644 index dd57d92..0000000 --- a/docs/articles/dataset-batch-processing_files/header-attrs-2.3/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/dataset-single.html b/docs/articles/dataset-single.html deleted file mode 100644 index f44db25..0000000 --- a/docs/articles/dataset-single.html +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - - -Use Case 1 - Processing a single dataset • metajam - - - - - - - - - - - - -
-
- - - - -
-
- - - - -
-

Summary -

-

This vignette aims to showcase a use case using the 2 main functions -of metajam - download_d1_data and -read_d1_files to download one dataset from the Arctic Data Center data -repository.

-

As example, we are using permafrost data from the Polaris Project -2017: Sarah Ludwig, Robert M Holmes, Susan Natali, Paul Mann, John -Schade, et al. 2018. Polaris Project 2017: Permafrost carbon and -nitrogen, Yukon-Kuskokwim Delta, Alaska. Arctic Data Center. doi:10.18739/A2KK3F.

-
-
-

Libraries and constants -

-
-# devtools::install_github("NCEAS/metajam")
-library(metajam)  
-
-# Directory to save the data set
-path_folder <- "Data_polaris"
-
-# URL to download the dataset from DataONE
-data_url <- "https://arcticdata.io/metacat/d1/mn/v2/object/urn%3Auuid%3Aec704da8-f174-49db-b993-bae479cdc5d9"
-
-
-

Download the dataset -

-
-# Create the local directory to download the datasets
-dir.create(path_folder, showWarnings = FALSE)
-
-# Download the dataset and associated metdata 
-data_folder <- metajam::download_d1_data(data_url, path_folder)
-# data_folder
-# "Data_polaris/doi_10.18739_A2KK3F__Polaris_2017_Permafrost"
-

At this point, you should have the data and the metadata downloaded -inside your main directory; Data_polaris in this example. -metajam organize the files as follow:

-
    -
  • Each dataset is stored a sub-directory named after the package DOI -and the file name
  • -
  • Inside this sub-directory, you will find -
      -
    • the data: my_data.csv -
    • -
    • the raw EML with the naming convention file name + -__full_metadata.xml: -my_data__full_metadata.xml -
    • -
    • the package level metadata summary with the naming convention -file name + __summary_metadata.csv: -my_data__summary_metadata.csv -
    • -
    • If relevant, the attribute level metadata with the naming convention -file name + __attribute_metadata.csv: -my_data__attribute_metadata.csv -
    • -
    • If relevant, the factor level metadata with the naming convention -file name + __attribute_factor_metadata.csv: -my_data__attribute_factor_metadata.csv -
    • -
    -
  • -
-
-Local file structure of a dataset downloaded by metajam

-Local file structure of a dataset downloaded by metajam -

-
-
-
-

Read the data and metadata in your R environment -

-
-# Read all the datasets and their associated metadata in as a named list
-polaris17_permafrost <- metajam::read_d1_files(data_folder)
-
-
-

Structure of the named list object -

-

You have now loaded in your R environment one named list object that -contains the data polaris17_permafrost$data, the general -(summary) metadata polaris17_permafrost$summary_metadata - -such as title, creators, dates, locations - and the attribute level -metadata information -polaris17_permafrost$attribute_metadata, allowing user to -get more information, such as units and definitions of your -attributes.

-
-Structure of the named list object containing tabular metadata and data as loaded by metajam

-Structure of the named list object containing tabular metadata and data -as loaded by metajam -

-
-
-
- - - -
- - - -
- -
-

-

Site built with pkgdown 2.0.7.

-
- -
-
- - - - - - - - diff --git a/docs/articles/dataset-single_files/accessible-code-block-0.0.1/empty-anchor.js b/docs/articles/dataset-single_files/accessible-code-block-0.0.1/empty-anchor.js deleted file mode 100644 index ca349fd..0000000 --- a/docs/articles/dataset-single_files/accessible-code-block-0.0.1/empty-anchor.js +++ /dev/null @@ -1,15 +0,0 @@ -// Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> -// v0.0.1 -// Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. - -document.addEventListener('DOMContentLoaded', function() { - const codeList = document.getElementsByClassName("sourceCode"); - for (var i = 0; i < codeList.length; i++) { - var linkList = codeList[i].getElementsByTagName('a'); - for (var j = 0; j < linkList.length; j++) { - if (linkList[j].innerHTML === "") { - linkList[j].setAttribute('aria-hidden', 'true'); - } - } - } -}); diff --git a/docs/articles/dataset-single_files/header-attrs-2.2/header-attrs.js b/docs/articles/dataset-single_files/header-attrs-2.2/header-attrs.js deleted file mode 100644 index dd57d92..0000000 --- a/docs/articles/dataset-single_files/header-attrs-2.2/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/dataset-single_files/header-attrs-2.3/header-attrs.js b/docs/articles/dataset-single_files/header-attrs-2.3/header-attrs.js deleted file mode 100644 index dd57d92..0000000 --- a/docs/articles/dataset-single_files/header-attrs-2.3/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/index.html b/docs/articles/index.html deleted file mode 100644 index 426150e..0000000 --- a/docs/articles/index.html +++ /dev/null @@ -1,123 +0,0 @@ - -Articles • metajam - - -
-
- - - -
- - -
- -
-

Site built with pkgdown 2.0.7.

-
- -
- - - - - - - - diff --git a/docs/articles/package-download.html b/docs/articles/package-download.html deleted file mode 100644 index d108cdf..0000000 --- a/docs/articles/package-download.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - -Use Case 3 - Downloading entire data packages using DOIs • metajam - - - - - - - - - - - - -
-
- - - - -
-
- - - - -
-

Summary -

-

This vignette aims to showcase a use case when the user wants to -download all the datasets of a data package using metajam - -download_d1_data_pkg.

-

In this example we use a csv file storing packages returned after -searching for soil bulk density on Arctic Data Center and KNB data repositories.

-
-
-

Libraries and constants -

-
-# devtools::install_github("NCEAS/metajam")
-library(metajam)  
-library(readr)
-library(purrr)
-
-# Directory to save the data set
-path_folder <- "./Soil_bulk"
-
-# URL to read the search results stored as a csv on Google Drive
-csv_search_results_url <- "https://drive.google.com/uc?export=download&id=1WTLP2BcXCXmUyv4kmntyhuPfrBNdPIqV"
-
-
-

Download all the datasets from data packages using DOIs -

-
-# Create the local directory to store data sets
-dir.create(path_folder, showWarnings = FALSE)
-
-# Read the data listing from Google Drive: https://drive.google.com/open?id=1WTLP2BcXCXmUyv4kmntyhuPfrBNdPIqV
-data_listing <- read_csv(csv_search_results_url)
-
-
-### Download the data and metadata ----
-
-# Create the list of unique dois
-dois <- unique(data_listing$identifier)
-
-# batch download the datasets
-data_folders <- map(dois, ~download_d1_data_pkg(.x, path_folder))
-
-
- - - -
- - - -
- -
-

-

Site built with pkgdown 2.0.7.

-
- -
-
- - - - - - - - diff --git a/docs/articles/package-download_files/accessible-code-block-0.0.1/empty-anchor.js b/docs/articles/package-download_files/accessible-code-block-0.0.1/empty-anchor.js deleted file mode 100644 index ca349fd..0000000 --- a/docs/articles/package-download_files/accessible-code-block-0.0.1/empty-anchor.js +++ /dev/null @@ -1,15 +0,0 @@ -// Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> -// v0.0.1 -// Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. - -document.addEventListener('DOMContentLoaded', function() { - const codeList = document.getElementsByClassName("sourceCode"); - for (var i = 0; i < codeList.length; i++) { - var linkList = codeList[i].getElementsByTagName('a'); - for (var j = 0; j < linkList.length; j++) { - if (linkList[j].innerHTML === "") { - linkList[j].setAttribute('aria-hidden', 'true'); - } - } - } -}); diff --git a/docs/articles/package-download_files/header-attrs-2.2/header-attrs.js b/docs/articles/package-download_files/header-attrs-2.2/header-attrs.js deleted file mode 100644 index dd57d92..0000000 --- a/docs/articles/package-download_files/header-attrs-2.2/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/package-download_files/header-attrs-2.3/header-attrs.js b/docs/articles/package-download_files/header-attrs-2.3/header-attrs.js deleted file mode 100644 index dd57d92..0000000 --- a/docs/articles/package-download_files/header-attrs-2.3/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/reading-raster.html b/docs/articles/reading-raster.html deleted file mode 100644 index 0bb8100..0000000 --- a/docs/articles/reading-raster.html +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - -Use Case 3 - Processing a raster dataset • metajam - - - - - - - - - - - - -
-
- - - - -
-
- - - - -
-

Summary -

-

This vignette aims to showcase how to overwrite the default function -used by metajam::read_d1_files (spoiler alert it is -readr::read_csv) to read none tabular dara. In this -specific vignette, we use the example of reading a geotiff file using -the raster package.

-

As example, we are using shipping routes frequency data used in the -final human impacts model of 17 marine ecosystems and the 22 stressor -drivers DOI: -10.5063/F15M63Z8.. For more information on this research, please see -Micheli F, Halpern BS, Walbridge S, Ciriaco S, Ferretti F, Fraschetti S, -et al. (2013) Cumulative Human Impacts on Mediterranean and Black Sea -Marine Ecosystems: Assessing Current Pressures and Opportunities. PLoS -ONE 8(12). https://doi.org/10.1371/journal.pone.0079889.

-
-
-

Libraries and constants -

-
-# devtools::install_github("NCEAS/metajam")
-library(metajam)
-library(raster)
-library(magrittr)
-
-# Directory to save the data set
-path_folder <- "Human_impacts"
-
-# URL to download the dataset from DataONE
-data_url <- "https://cn.dataone.org/cn/v2/resolve/urn:uuid:6f101827-2fc3-43da-8c8d-7b1f927c4c73"
-
-
-

Download the raster dataset -

-
-# Create the local directory to download the datasets
-dir.create(path_folder, showWarnings = FALSE)
-
-# Download the dataset and associated metdata 
-data_folder <- metajam::download_d1_data(data_url, path_folder)
-# data_folder
-# "Human_impacts/doi_10.5063_F15M63Z8__shipping__tif"
-

At this point, you should have the data and the metadata downloaded -inside your main directory; human_impacts in this example. -metajam organize the files as follow:

-
    -
  • Each dataset is stored a sub-directory named after the package DOI -and the file name
  • -
  • Inside this sub-directory, you will find -
      -
    • the data: shipping.tif -
    • -
    • the raw EML with the naming convention file name + -__full_metadata.xml: -shipping__full_metadata.xml -
    • -
    • the package level metadata summary with the naming convention -file name + __summary_metadata.csv: -shipping__summary_metadata.csv -
    • -
    -
  • -
-
-
-

Read the raster file and metadata in your R environment -

-
-# Read the raster file and its associated metadata in as a named list
-# using the raster:raster function
-shipping_routes <-  read_d1_files(data_folder, "raster")
-
-# Plot the raster data
-plot(shipping_routes$data)
-
-Shipping routes frequency

-Shipping routes frequency -

-
-
-
-

Investigate the metadata -

-
-shipping_routes$summary_metadata
-

-
-
- - - -
- - - -
- -
-

-

Site built with pkgdown 2.0.7.

-
- -
-
- - - - - - - - diff --git a/docs/articles/reading-raster_files/accessible-code-block-0.0.1/empty-anchor.js b/docs/articles/reading-raster_files/accessible-code-block-0.0.1/empty-anchor.js deleted file mode 100644 index ca349fd..0000000 --- a/docs/articles/reading-raster_files/accessible-code-block-0.0.1/empty-anchor.js +++ /dev/null @@ -1,15 +0,0 @@ -// Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> -// v0.0.1 -// Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. - -document.addEventListener('DOMContentLoaded', function() { - const codeList = document.getElementsByClassName("sourceCode"); - for (var i = 0; i < codeList.length; i++) { - var linkList = codeList[i].getElementsByTagName('a'); - for (var j = 0; j < linkList.length; j++) { - if (linkList[j].innerHTML === "") { - linkList[j].setAttribute('aria-hidden', 'true'); - } - } - } -}); diff --git a/docs/articles/reading-raster_files/figure-html/read_raster-1.png b/docs/articles/reading-raster_files/figure-html/read_raster-1.png deleted file mode 100644 index 2777116b8d1a6b4476626af0657501a8d075e9ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 205490 zcmeFZXIN9&+CB~_f^iHwQWO%3%veCg27%B)KvATIARSSu3891@5D-BTupvqdMOp$0 zC>=r-Q4vB5EmRQ#2>}#BXn}t`@AZ4%8P7SN{$Js4}TC3&mL#NecUtle0>f)JbRD1>*<+#>KW>JdwKg>pqyRq7~VnN z@pX4GH`L|fQAtRE*}H*Y!kTq{uCjl0S$JKF@h{Xm_~*grR+qBNYa_{TADg&^Hw2#!Sce8~D;*xlm3t$}qydj%UrL^cal54l- zs?KY_R}871av5y((+p2=zx(aX*Sc-`z#k|t2k|s$e$x$`%MheFLh0nu^DNewR`zpyzf2Y z&3$;Y#|b7Q3N>`bhFM#eSQs`eMj0O&(QxqHe*ROh&c%`d#@2fd-#(?iZ$fm)ttc9} z?}BiN@UcgZ*>}YxXie%rpyjVSn;TkQ?0o#_7`;*5RW5fsRx?WUt@w6gv1s3&@Aw!y zmm^x?XCQo9Cyq(~J{(PUxNvptsm}%8E=4e1m_l@@=>IQup?H>w=fHUm#2zv2R**x#xA;!#41W&-ZU|A%p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