diff --git a/DESCRIPTION b/DESCRIPTION index 378cd20..daea33a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,48 +20,51 @@ BugReports: https://github.com/david-beauchesne/pipedat/issues Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 Config/testthat/edition: 3 +Depends: + R (>= 3.3.0) Imports: + archive, + bookdown, cli, crayon, curl, dplyr, glue, + grDevices, here, + ids, RefManageR, + rgovcan, rlang, + rmarkdown, sf, stars, + stringr, + terra, + tools, utils, + vroom, yaml -Depends: - R (>= 2.10) Suggests: - archive, eaMethods, fasterize, fs, geojsonsf, graphics, - graphicsutils, - grDevices, - ids, knitr, latex2exp, purrr, raster, readr, - rgovcan, R.utils, sdmpredictors, stats, - stringr, testthat (>= 3.0.0), tidyr, usethis, uuid, viridis, - vroom, whisker, XML diff --git a/NAMESPACE b/NAMESPACE index 68f82cb..9b06e2f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -49,7 +49,6 @@ export(write_pipeline) importFrom(RefManageR,BibEntry) importFrom(RefManageR,WriteBib) importFrom(cli,symbol) -importFrom(crayon,blue) importFrom(glue,glue) importFrom(glue,glue_sql) importFrom(grDevices,colorRampPalette) diff --git a/R/helpers.R b/R/helpers.R index 1caeff3..4292be1 100644 --- a/R/helpers.R +++ b/R/helpers.R @@ -212,8 +212,8 @@ get_pipeline_url <- function(uid) { #' @export get_grid_info <- function(grd = here::here("project-data", "grid", "grid.tif")) { # Get grid - if (class(grd) == "character") grd <- stars::read_stars(grd) - if (!"stars" %in% class(grd)) grd <- stars::st_as_stars(grd) + if (inherits(grd, "character")) grd <- stars::read_stars(grd) + if (!inherits(grd, "stars")) grd <- stars::st_as_stars(grd) # Info list( diff --git a/R/importdat.R b/R/importdat.R index c7151cf..e691a13 100644 --- a/R/importdat.R +++ b/R/importdat.R @@ -4,8 +4,8 @@ #' in the global R environment for use in other pipelines or #' user processes. #' -#' @param uid unique identifier of queried data. The full list of available data pipelines can be consulted using `pipelines()` -#' @param type type of data to import, one of "format" or "integrated" +#' @param uid unique identifier of queried data. The full list of available data pipelines can be consulted using `pipelist()`. +#' @param type type of data to import, one of "format" or "integrated". #' #' @return This function returns objects in the global R environment #' diff --git a/R/masteringrid.R b/R/masteringrid.R index 55e46d2..1423a8e 100644 --- a/R/masteringrid.R +++ b/R/masteringrid.R @@ -18,11 +18,11 @@ #' @export masteringrid <- function(dat, grd = here::here("project-data", "grid", "grid.tif")) { # Get grid - if (class(grd) == "character") grd <- stars::read_stars(grd) - if (!"stars" %in% class(grd)) grd <- stars::st_as_stars(grd) + if (inherits(grd, "character")) grd <- stars::read_stars(grd) + if (!inherits(grd, "stars")) grd <- stars::st_as_stars(grd) # stars objects - if ("stars" %in% class(dat)) { + if (inherits(dat, "stars")) { stars::st_warp(dat, grd) } diff --git a/R/pipedat.R b/R/pipedat.R index 5e2fec3..76fdb77 100644 --- a/R/pipedat.R +++ b/R/pipedat.R @@ -5,7 +5,7 @@ #' built to access data programmatically and reproducibly, which #' we refer to as *data pipelines*. #' -#' @param uid unique identifier of queried data. The full list of available data pipelines can be consulted using `pipelines()` +#' @param uid unique identifier of queried data. The full list of available data pipelines can be consulted using `pipelist()` #' @eval dp_params() #' @param ... further arguments used in functions, if applicable. #' diff --git a/R/pipelist.R b/R/pipelist.R index 096f76d..6ad1b5c 100644 --- a/R/pipelist.R +++ b/R/pipelist.R @@ -1,4 +1,4 @@ -#' List of available data pipalines +#' List of available data pipelines #' #' This function provides the list of individual scripts #' built to access data programmatically and reproducibly, which diff --git a/R/pipeload.R b/R/pipeload.R index 58d25ec..0c5757e 100644 --- a/R/pipeload.R +++ b/R/pipeload.R @@ -5,10 +5,10 @@ #' built to access data programmatically and reproducibly, which #' we refer to as *data pipelines*. #' -#' @param urls urls for data download -#' @param govcan unique identifier of resource on the open government federal data portal to download +#' @param urls urls for data download. +#' @param govcan unique identifier of resource on the open government federal data portal to download. #' @param output output folder for queried data. -#' @param large logical, whether file to download is large and thus R options should be modified for longer timeout options. Default set to false +#' @param large logical, whether file to download is large and thus R options should be modified for longer timeout options. Default set to `FALSE`. #' #' @return This function returns the queried raw data, formatted data, metadata and bibtex associated with the raw data. #' diff --git a/R/pipereport.R b/R/pipereport.R index b50f00f..e8bfbf9 100644 --- a/R/pipereport.R +++ b/R/pipereport.R @@ -1,6 +1,6 @@ #' Create a report from the pipedat data in a project #' -#' This function create a generic report that provides a summary of the data that was loaded and formatted throught the pipedat package in a specific location. The purpose of this report is to accompany a project report by providing the relevant information concerning the data that was accessed and formated through pipedat. +#' This function creates a generic report that provides a summary of the data that was loaded and formatted throught the pipedat package in a specific location. The purpose of this report is to accompany a project report by providing the relevant information concerning the data that was accessed and formated through pipedat. #' #' @return This function creates a new report in `pubs/pipedat/` using the template `inst/templates/report.Rmd` and all the data available in `project-data/pipedat/` and `project-data/grid/`. #' diff --git a/R/zzz.R b/R/zzz.R index 97a5a8c..b4e60d7 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,12 +1,10 @@ #' pipedat: pipelines to access, load, and format data from various sources #' -#' @docType package #' @name pipedat #' #' @importFrom glue glue glue_sql #' @importFrom grDevices dev.off png colorRampPalette -#' @importFrom graphics par box layout lines mtext -#' @importFrom graphics polygon text +#' @importFrom graphics par box layout lines mtext polygon text #' @importFrom RefManageR BibEntry WriteBib #' @importFrom rlang sym #' @importFrom sf st_bbox st_write st_read st_transform @@ -22,7 +20,6 @@ #' @importFrom yaml yaml.load_file write_yaml read_yaml #' @importFrom rlang abort warn #' @importFrom cli symbol -#' @importFrom crayon blue NULL diff --git a/README.Rmd b/README.Rmd index 55ca546..9a7dec2 100644 --- a/README.Rmd +++ b/README.Rmd @@ -16,8 +16,6 @@ knitr::opts_chunk$set( # pipedat - - [![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#preliminary) ![](https://img.shields.io/badge/status-preliminary-blue.svg) [![R-CMD-check](https://github.com/Ecosystem-Assessments/pipedat/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Ecosystem-Assessments/pipedat/actions/workflows/R-CMD-check.yaml) diff --git a/inst/templates/pipeflow.yml b/inst/templates/pipeflow.yml index 0561efc..016585e 100644 --- a/inst/templates/pipeflow.yml +++ b/inst/templates/pipeflow.yml @@ -17,7 +17,7 @@ pipedat: - 2021 - 2022 # ========================================================================== - # UID of pipelines to eexecute + # UID of pipelines to execute pipelines: - "pipeline_id1" - "pipeline_id2" diff --git a/man/importdat.Rd b/man/importdat.Rd index d807726..d2ef8bc 100644 --- a/man/importdat.Rd +++ b/man/importdat.Rd @@ -7,9 +7,9 @@ importdat(uid, type) } \arguments{ -\item{uid}{unique identifier of queried data. The full list of available data pipelines can be consulted using \code{pipelines()}} +\item{uid}{unique identifier of queried data. The full list of available data pipelines can be consulted using \code{pipelist()}.} -\item{type}{type of data to import, one of "format" or "integrated"} +\item{type}{type of data to import, one of "format" or "integrated".} } \value{ This function returns objects in the global R environment diff --git a/man/pipedat.Rd b/man/pipedat.Rd index ce9b978..167d3a9 100644 --- a/man/pipedat.Rd +++ b/man/pipedat.Rd @@ -1,6 +1,5 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/pipedat.R, R/zzz.R -\docType{package} \name{pipedat} \alias{pipedat} \title{Execute data pipelines} @@ -15,7 +14,7 @@ pipedat( ) } \arguments{ -\item{uid}{unique identifier of queried data. The full list of available data pipelines can be consulted using \code{pipelines()}} +\item{uid}{unique identifier of queried data. The full list of available data pipelines can be consulted using \code{pipelist()}} \item{bbox}{bounding box to spatially subset the queried data, if applicable. The bounding box should be of the form \code{c(xmin, ymin, xmax, ymax)}} diff --git a/man/pipelist.Rd b/man/pipelist.Rd index d4df8e8..f42417e 100644 --- a/man/pipelist.Rd +++ b/man/pipelist.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/pipelist.R \name{pipelist} \alias{pipelist} -\title{List of available data pipalines} +\title{List of available data pipelines} \usage{ pipelist() } diff --git a/man/pipeload.Rd b/man/pipeload.Rd index 85c27d8..91e4ad9 100644 --- a/man/pipeload.Rd +++ b/man/pipeload.Rd @@ -7,13 +7,13 @@ pipeload(urls = NULL, govcan = NULL, output, large = FALSE) } \arguments{ -\item{urls}{urls for data download} +\item{urls}{urls for data download.} -\item{govcan}{unique identifier of resource on the open government federal data portal to download} +\item{govcan}{unique identifier of resource on the open government federal data portal to download.} \item{output}{output folder for queried data.} -\item{large}{logical, whether file to download is large and thus R options should be modified for longer timeout options. Default set to false} +\item{large}{logical, whether file to download is large and thus R options should be modified for longer timeout options. Default set to \code{FALSE}.} } \value{ This function returns the queried raw data, formatted data, metadata and bibtex associated with the raw data. diff --git a/man/pipereport.Rd b/man/pipereport.Rd index b8ecf32..2ec8519 100644 --- a/man/pipereport.Rd +++ b/man/pipereport.Rd @@ -10,7 +10,7 @@ pipereport() This function creates a new report in \verb{pubs/pipedat/} using the template \code{inst/templates/report.Rmd} and all the data available in \verb{project-data/pipedat/} and \verb{project-data/grid/}. } \description{ -This function create a generic report that provides a summary of the data that was loaded and formatted throught the pipedat package in a specific location. The purpose of this report is to accompany a project report by providing the relevant information concerning the data that was accessed and formated through pipedat. +This function creates a generic report that provides a summary of the data that was loaded and formatted throught the pipedat package in a specific location. The purpose of this report is to accompany a project report by providing the relevant information concerning the data that was accessed and formated through pipedat. } \examples{ \dontrun{