diff --git a/.Rbuildignore b/.Rbuildignore index ffd8238..09f18ee 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -17,3 +17,4 @@ bibliography.bib cran-comments.md ^revdep$ ^$ +^cran-comments\.md$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index f66c762..0bd8a17 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -21,7 +21,7 @@ bug, create an associated issue and illustrate the bug with a minimal * Look at the Travis and AppVeyor build status before and after making changes. The `README` should contain badges for any continuous integration services used by the package. -* We recommend the tidyverse [style guide](http://style.tidyverse.org). +* We recommend the tidyverse [style guide](https://style.tidyverse.org). You can use the [styler](https://CRAN.R-project.org/package=styler) package to apply these styles, but please don't restyle code that has nothing to do with your PR. diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..f598156 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,96 @@ +# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. +# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions +on: + push: + branches: + - main + - master + - develop + pull_request: + branches: + - main + - master + - develop + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: windows-latest, r: 'release'} + - {os: macOS-latest, r: 'release'} + - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + + env: + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true + RSPM: ${{ matrix.config.rspm }} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@v1 + with: + r-version: ${{ matrix.config.r }} + + - uses: r-lib/actions/setup-pandoc@v1 + + - name: Query dependencies + run: | + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Cache R packages + if: runner.os != 'Windows' + uses: actions/cache@v2 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + + - name: Install system dependencies + if: runner.os == 'Linux' + run: | + while read -r cmd + do + eval sudo $cmd + done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') + + - name: Install dependencies + run: | + remotes::install_deps(dependencies = TRUE) + remotes::install_cran("rcmdcheck") + remotes::install_cran("covr") + install.packages("tinytex") + library(tinytex) + install_tinytex() + shell: Rscript {0} + + - name: Check + env: + _R_CHECK_CRAN_INCOMING_REMOTE_: false + run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") + shell: Rscript {0} + + - name: Upload check results + if: failure() + uses: actions/upload-artifact@main + with: + name: ${{ runner.os }}-r${{ matrix.config.r }}-results + path: check + + - name: Test coverage + run: covr::codecov() + shell: Rscript {0} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1185943..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: r -sudo: required -addons: - apt: - packages: - - libgit2-dev -matrix: - include: - - os: linux - r: release - - os: linux - r: devel - -cache: - packages: TRUE -r_github_packages: - - r-lib/covr - - r-lib/usethis -after_success: - - Rscript -e 'covr::codecov()' - diff --git a/CRAN-RELEASE b/CRAN-RELEASE index 92cd9a9..94e27c3 100644 --- a/CRAN-RELEASE +++ b/CRAN-RELEASE @@ -1,2 +1,2 @@ -This package was submitted to CRAN on 2019-03-30. -Once it is accepted, delete this file and tag the release (commit 56af129a9c). +This package was submitted to CRAN on 2021-03-16. +Once it is accepted, delete this file and tag the release (commit 96c7270). diff --git a/DESCRIPTION b/DESCRIPTION index e1b3684..7ff6060 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,9 +2,15 @@ Package: DataPackageR Type: Package Title: Construct Reproducible Analytic Data Sets as R Packages Authors@R: - c(person(given = "Greg Finak", role=c("aut","cre","cph"), email="gfinak@fredhutch.org"), + c(person(given = "Greg Finak", + role=c("aut","cph"), + email="greg.finak@gmail.com", + comment="Original author and creator of DataPackageR"), person(given = "Paul Obrecht", role=c("ctb")), - person(given = "Ellis Hughes", role=c("ctb")), + person(given = "Ellis Hughes", role=c("ctb","cre"), email = "ehhughes@scharp.org"), + person(given = "Jimmy Fulp", role=c("ctb"), email = "wfulp@scharp.org"), + person(given = "Marie Vendettuoli", role=c("ctb"), email = "mvendett@scharp.org"), + person(given = "Jason Taylor", role=c("ctb")), person("Kara", "Woo", role = "rev", comment = "Kara reviewed the package for ropensci, see "), person("William", "Landau", role = "rev", @@ -41,15 +47,15 @@ Imports: usethis, crayon VignetteBuilder: knitr -RoxygenNote: 7.1.0 +RoxygenNote: 7.1.1 Encoding: UTF-8 Suggests: spelling, testthat, covr, data.tree, -URL: https://docs.ropensci.org/DataPackageR (website) - https://github.com/ropensci/DataPackageR +URL: https://docs.ropensci.org/DataPackageR/ (website) + https://github.com/ropensci/DataPackageR/ BugReports: https://github.com/ropensci/DataPackageR/issues SystemRequirements: pandoc (>= 1.12.3) - http://pandoc.org Language: en-US diff --git a/NEWS.md b/NEWS.md index 6f2da8b..2af6c51 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,9 @@ # DataPackageR 0.15.8 * Fix to datapackager_object_read that was causing a test to break. `get` needs to have `inherits=FALSE`. * Other fixes for `usethis` 1.6.0 +* Fixes to tests that were failing on CRAN +* In `package_build`, remove `devtools::reload` and put `devtools::unload` and in front of install.packages +* in `document`, remove `devtools::reload` and put in `devtools::unload` and install.packages # DataPackageR 0.15.7 * Fix test and vignette bugs related to upcoming version of usethis (1.5) diff --git a/R/build.R b/R/build.R index fa17151..c7f5952 100644 --- a/R/build.R +++ b/R/build.R @@ -98,8 +98,8 @@ package_build <- function(packageName = NULL, ) # try to install and then reload the package in the current session if (install) { + devtools::unload(packageName) install.packages(location, repos = NULL, type = "source", ...) - devtools::reload(package_path) } .next_steps() return(location) diff --git a/R/processData.R b/R/processData.R index 7756c8e..ad174c3 100644 --- a/R/processData.R +++ b/R/processData.R @@ -834,9 +834,10 @@ document <- function(path = ".", install = TRUE, ...) { pkg = path, path = dirname(path), vignettes = FALSE, quiet = TRUE ) + # try to install and then reload the package in the current session if (install) { - install.packages(location, repos = NULL, type = "source", quiet = TRUE, ...) - devtools::reload(path, quiet = TRUE) + devtools::unload(basename(path)) + install.packages(location, repos = NULL, type = "source", ...) } return(TRUE) } diff --git a/README.Rmd b/README.Rmd index c8dc738..6fcb38c 100644 --- a/README.Rmd +++ b/README.Rmd @@ -20,17 +20,17 @@ knitr::opts_chunk$set( DataPackageR is used to reproducibly process raw data into packaged, analysis-ready data sets. + [![CRAN](https://www.r-pkg.org/badges/version/DataPackageR)]( https://CRAN.R-project.org/package=DataPackageR) -[![Build Status](https://travis-ci.org/ropensci/DataPackageR.svg?branch=master)](https://travis-ci.org/ropensci/DataPackageR) - [![Coverage status](https://codecov.io/gh/ropensci/DataPackageR/branch/master/graph/badge.svg)](https://codecov.io/github/ropensci/DataPackageR?branch=master) - [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/5y004036wg2rh2dx?svg=true -)](https://ci.appveyor.com/project/gfinak/DataPackageR) +[![R-CMD-check](https://github.com/ropensci/DataPackageR/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/DataPackageR/actions) +[![Coverage status](https://codecov.io/gh/ropensci/DataPackageR/branch/master/graph/badge.svg)](https://codecov.io/github/ropensci/DataPackageR?branch=master) [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) -[![](https://badges.ropensci.org/230_status.svg)](https://github.com/ropensci/onboarding/issues/230) +[![](https://badges.ropensci.org/230_status.svg)](https://github.com/ropensci/software-review/issues/230) [![DOI](https://zenodo.org/badge/29267435.svg)](https://doi.org/10.5281/zenodo.1292095) + -- [yaml configuration guide](vignettes/YAML_CONFIG.md) -- [a more detailed technical vignette](vignettes/usingDataPackageR.md) +- [yaml configuration guide](https://github.com/ropensci/DataPackageR/blob/main/vignettes/YAML_CONFIG.md) +- [a more detailed technical vignette](https://github.com/ropensci/DataPackageR/blob/main/vignettes/usingDataPackageR.md) > **Important Note**: [datapack](https://github.com/ropensci/datapack) is a *different package* that is used to "create, send and load data from common repositories such as DataONE into the R environment". @@ -63,7 +63,7 @@ You have diverse raw data sets that you need to preprocess and tidy in order to: - **Documentation.** - R's package system allows us to document data objects. What's more, the `roxygen2` package makes this very easy to do with [markup tags](http://r-pkgs.had.co.nz/data.html). + R's package system allows us to document data objects. What's more, the `roxygen2` package makes this very easy to do with [markup tags](https://r-pkgs.org/data.html). That documentation is the equivalent of a data dictionary and can be extremely valuable when returning to a project after a period of time. - **Convenience.** @@ -77,7 +77,7 @@ You have diverse raw data sets that you need to preprocess and tidy in order to: R packages have a 5MB size limit, at least on CRAN. BioConductor has explicit [data package](https://www.bioconductor.org/developers/package-guidelines/#package-types) types that can be larger and use git LFS for very large files. - Sharing large volumes of raw data in an R package format is still not ideal, and there are public biological data repositories better suited for raw data: e.g., [GEO](https://www.ncbi.nlm.nih.gov/geo/), [SRA](https://www.ncbi.nlm.nih.gov/sra), [ImmPort](http://www.immport.org/immport-open/public/home/home), [ImmuneSpace](https://immunespace.org/), [FlowRepository](https://flowrepository.org/). + Sharing large volumes of raw data in an R package format is still not ideal, and there are public biological data repositories better suited for raw data: e.g., [GEO](https://www.ncbi.nlm.nih.gov/geo/), [SRA](https://www.ncbi.nlm.nih.gov/sra), [ImmPort](https://www.immport.org:443/shared/immport-open/public/home/home), [ImmuneSpace](https://immunespace.org/), [FlowRepository](https://flowrepository.org/). Tools like [datastorr](https://github.com/ropenscilabs/datastorr) can help with this and we hope to integrate the into DataPackageR in the future. @@ -142,11 +142,11 @@ There are a number of tools out there that address similar and complementary pro ## Installation -You can install the latest version of DataPackageR from [github](https://www.github.com/RGLab/DataPackageR) with: +You can install the latest version of DataPackageR from [github](https://github.com/ropensci/DataPackageR) with: ```{r, eval=FALSE} library(devtools) -devtools::install_github("RGLab/DataPackageR") +devtools::install_github("ropensci/DataPackageR") ``` ## Blog Post - building packages interactively. @@ -259,7 +259,7 @@ The preprint is on [biorxiv](https://doi.org/10.1101/342907). ## Code of conduct -Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). +Please note that this project is released with a [Contributor Code of Conduct](https://github.com/ropensci/DataPackageR/blob/main/CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. ### References diff --git a/README.md b/README.md index 28831ca..00aad97 100644 --- a/README.md +++ b/README.md @@ -4,28 +4,29 @@ README # DataPackageR DataPackageR is used to reproducibly process raw data into packaged, -analysis-ready data -sets. +analysis-ready data sets. + + [![CRAN](https://www.r-pkg.org/badges/version/DataPackageR)](https://CRAN.R-project.org/package=DataPackageR) -[![Build -Status](https://travis-ci.org/ropensci/DataPackageR.svg?branch=master)](https://travis-ci.org/ropensci/DataPackageR) +[![R-CMD-check](https://github.com/ropensci/DataPackageR/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/DataPackageR/actions) [![Coverage status](https://codecov.io/gh/ropensci/DataPackageR/branch/master/graph/badge.svg)](https://codecov.io/github/ropensci/DataPackageR?branch=master) -[![AppVeyor Build -Status](https://ci.appveyor.com/api/projects/status/5y004036wg2rh2dx?svg=true)](https://ci.appveyor.com/project/gfinak/DataPackageR) [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) -[![](https://badges.ropensci.org/230_status.svg)](https://github.com/ropensci/onboarding/issues/230) +[![](https://badges.ropensci.org/230_status.svg)](https://github.com/ropensci/software-review/issues/230) [![DOI](https://zenodo.org/badge/29267435.svg)](https://doi.org/10.5281/zenodo.1292095) + - - [yaml configuration guide](vignettes/YAML_CONFIG.md) - - [a more detailed technical vignette](vignettes/usingDataPackageR.md) +- [yaml configuration + guide](https://github.com/ropensci/DataPackageR/blob/main/vignettes/YAML_CONFIG.md) +- [a more detailed technical + vignette](https://github.com/ropensci/DataPackageR/blob/main/vignettes/usingDataPackageR.md) > **Important Note**: [datapack](https://github.com/ropensci/datapack) > is a *different package* that is used to “create, send and load data -> from common repositories such as DataONE into the R environment”. +> from common repositories such as DataONE into the R environment.” > **This package** is for processing raw data into tidy data sets and > bundling them into R packages. @@ -35,11 +36,11 @@ developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.re You have diverse raw data sets that you need to preprocess and tidy in order to: - - Perform data analysis - - Write a report - - Publish a paper - - Share data with colleagues and collaborators - - Save time in the future when you return to this project but have +- Perform data analysis +- Write a report +- Publish a paper +- Share data with colleagues and collaborators +- Save time in the future when you return to this project but have forgotten all about what you did. ### Why package data sets? @@ -47,31 +48,31 @@ order to: **Definition:** A *data package* is a formal R package whose sole purpose is to contain, access, and / or document data sets. - - **Reproducibility.** - +- **Reproducibility.** + As described [elsewhere](https://github.com/ropensci/rrrpkg), packaging your data promotes reproducibility. R’s packaging infrastructure promotes unit testing, documentation, a reproducible build system, and has many other benefits. Coopting it for packaging data sets is a natural fit. - - **Collaboration.** - +- **Collaboration.** + A data set packaged in R is easy to distribute and share amongst collaborators, and is easy to install and use. All the hard work you’ve put into documenting and standardizing the tidy data set comes right along with the data package. - - **Documentation.** - +- **Documentation.** + R’s package system allows us to document data objects. What’s more, the `roxygen2` package makes this very easy to do with [markup - tags](http://r-pkgs.had.co.nz/data.html). That documentation is the + tags](https://r-pkgs.org/data.html). That documentation is the equivalent of a data dictionary and can be extremely valuable when returning to a project after a period of time. - - **Convenience.** - +- **Convenience.** + Data pre-processing can be time consuming, depending on the data type and raw data sets may be too large to share conveniently in a packaged format. Packaging and sharing the small, tidied data saves @@ -79,34 +80,34 @@ purpose is to contain, access, and / or document data sets. ## Challenges. - - **Package size limits.** - +- **Package size limits.** + R packages have a 5MB size limit, at least on CRAN. BioConductor has explicit [data package](https://www.bioconductor.org/developers/package-guidelines/#package-types) types that can be larger and use git LFS for very large files. - + Sharing large volumes of raw data in an R package format is still not ideal, and there are public biological data repositories better suited for raw data: e.g., [GEO](https://www.ncbi.nlm.nih.gov/geo/), [SRA](https://www.ncbi.nlm.nih.gov/sra), - [ImmPort](http://www.immport.org/immport-open/public/home/home), + [ImmPort](https://www.immport.org:443/shared/immport-open/public/home/home), [ImmuneSpace](https://immunespace.org/), [FlowRepository](https://flowrepository.org/). - + Tools like [datastorr](https://github.com/ropenscilabs/datastorr) can help with this and we hope to integrate the into DataPackageR in the future. - - **Manual effort** - +- **Manual effort** + There is still a substantial manual effort to set up the correct directory structures for an R data package. This can dissuade many individuals, particularly new users who have never built an R package, from going this route. - - **Scale** - +- **Scale** + Setting up and building R data packages by hand is a workable solution for a small project or a small number of projects, but when dealing with many projects each involving many data sets, tools are @@ -116,23 +117,23 @@ purpose is to contain, access, and / or document data sets. DataPackageR provides a number of benefits when packaging your data. - - It aims to automate away much of the tedium of packaging data sets +- It aims to automate away much of the tedium of packaging data sets without getting too much in the way, and keeps your processing workflow reproducible. - - It sets up the necessary package structure and files for a data +- It sets up the necessary package structure and files for a data package. - - It allows you to keep the large, raw data and only ship the packaged +- It allows you to keep the large, raw data and only ship the packaged tidy data, saving space and time consumers of your data set need to spend downloading and re-processing it. - - It maintains a reproducible record (vignettes) of the data +- It maintains a reproducible record (vignettes) of the data processing along with the package. Consumers of the data package can verify how the processing was done, increasing confidence in your data. - - It automates construction of the documentation and maintains a data +- It automates construction of the documentation and maintains a data set version and an md5 fingerprint of each data object in the package. If the data changes and the package is rebuilt, the data version is automatically updated. @@ -142,40 +143,40 @@ DataPackageR provides a number of benefits when packaging your data. There are a number of tools out there that address similar and complementary problems: - - **datastorr** [github +- **datastorr** [github repo](https://github.com/ropenscilabs/datastorr) - + Simple data retrieval and versioning using GitHub to store data. - - - Caches downloads and uses github releases to version data. - - Deal consistently with translating the file stored online into a + + - Caches downloads and uses github releases to version data. + - Deal consistently with translating the file stored online into a loaded data object - - Access multiple versions of the data at once - + - Access multiple versions of the data at once + `datastorrr` could be used with DataPackageR to store / access remote raw data sets, remotely store / access tidied data that are too large to fit in the package itself. - - **fst** [github repo](https://github.com/fstpackage/fst) - +- **fst** [github repo](https://github.com/fstpackage/fst) + `fst` provides lightning fast serialization of data frames. - - **The modern data package** +- **The modern data package** [pdf](https://github.com/noamross/2018-04-18-rstats-nyc/blob/master/Noam_Ross_ModernDataPkg_rstatsnyc_2018-04-20.pdf) - + A presentation from @noamross touching on modern tools for open science and reproducibility. Discusses `datastorr` and `fst` as well as standardized metadata and documentation. - - **rrrpkg** [github repo](https://github.com/ropensci/rrrpkg) - +- **rrrpkg** [github repo](https://github.com/ropensci/rrrpkg) + A document from ropensci describing using an R package as a research compendium. Based on ideas originally introduced by Robert Gentleman and Duncan Temple Lang (Gentleman and Lang (2004)) - - **template** [github repo](https://github.com/ropensci/rrrpkg) - +- **template** [github repo](https://github.com/ropensci/rrrpkg) + An R package template for data packages. See the [publication](#publication) for further discussion. @@ -183,11 +184,11 @@ See the [publication](#publication) for further discussion. ## Installation You can install the latest version of DataPackageR from -[github](https://www.github.com/RGLab/DataPackageR) with: +[github](https://github.com/ropensci/DataPackageR) with: ``` r library(devtools) -devtools::install_github("RGLab/DataPackageR") +devtools::install_github("ropensci/DataPackageR") ``` ## Blog Post - building packages interactively. @@ -234,16 +235,20 @@ datapackage_skeleton( # These will be added to the NEWS.md file along with the DataVersion in the package source directory. # If the build is run in non-interactive mode, the description will read # "Package built in non-interactive mode". You may update it later. -package_build(packageName = file.path(tempdir(),"mtcars20"), install = TRUE) +dir.create(file.path(tempdir(),"lib")) +package_build(packageName = file.path(tempdir(),"mtcars20"), install = TRUE, lib = file.path(tempdir(),"lib")) +#> Warning: package 'mtcars20' is in use and will not be installed # Update the autogenerated roxygen documentation in data-raw/documentation.R. # edit(file.path(tempdir(),"mtcars20","R","mtcars20.R")) # 4. Rebuild the documentation. -document(file.path(tempdir(),"mtcars20"), install = TRUE) +document(file.path(tempdir(),"mtcars20"), install = TRUE, lib = file.path(tempdir(),"lib")) +#> Warning: package 'mtcars20' is in use and will not be installed # Let's use the package we just created. install.packages(file.path(tempdir(),"mtcars20_1.0.tar.gz"), type = "source", repos = NULL) +#> Warning: package 'mtcars20' is in use and will not be installed library(mtcars20) data("cars_over_20") # load the data cars_over_20 # Now we can use it. @@ -306,8 +311,8 @@ The preprint is on [biorxiv](https://doi.org/10.1101/342907). ## Code of conduct Please note that this project is released with a [Contributor Code of -Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree -to abide by its terms. +Conduct](https://github.com/ropensci/DataPackageR/blob/main/CODE_OF_CONDUCT.md). +By participating in this project you agree to abide by its terms. ### References diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 226ff60..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,48 +0,0 @@ -# DO NOT CHANGE the "init" and "install" sections below - -# Download script file from GitHub -init: - ps: | - $ErrorActionPreference = "Stop" - Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1" - Import-Module '..\appveyor-tool.ps1' - -install: - ps: Bootstrap - -environment: - R_VERSION: release - -cache: - - C:\RLibrary - -# Adapt as necessary starting from here - -build_script: - - travis-tool.sh install_deps - -test_script: - - travis-tool.sh run_tests - -on_failure: - - 7z a failure.zip *.Rcheck\* - - appveyor PushArtifact failure.zip - -artifacts: - - path: '*.Rcheck\**\*.log' - name: Logs - - - path: '*.Rcheck\**\*.out' - name: Logs - - - path: '*.Rcheck\**\*.fail' - name: Logs - - - path: '*.Rcheck\**\*.Rout' - name: Logs - - - path: '\*_*.tar.gz' - name: Bits - - - path: '\*_*.zip' - name: Bits diff --git a/codemeta.json b/codemeta.json index e2903cb..b60faaf 100644 --- a/codemeta.json +++ b/codemeta.json @@ -7,22 +7,21 @@ "identifier": "DataPackageR", "description": "A framework to help construct R data packages in a \n reproducible manner. Potentially time consuming processing of \n raw data sets into analysis ready data sets is done in a reproducible \n manner and decoupled from the usual R CMD build process so that\n data sets can be processed into R objects in the data package and \n the data package can then be shared, built, and installed by others\n without the need to repeat computationally costly data processing.\n The package maintains data provenance by turning the data processing\n scripts into package vignettes, as well as enforcing documentation \n and version checking of included data objects. Data packages can be\n version controlled in github, and used to share data for manuscripts,\n collaboration and general reproducibility.", "name": "DataPackageR: Construct Reproducible Analytic Data Sets as R Packages", - "codeRepository": "https://github.com/ropensci/DataPackageR", + "codeRepository": "https://github.com/ropensci/DataPackageR/", "issueTracker": "https://github.com/ropensci/DataPackageR/issues", "license": "https://spdx.org/licenses/MIT", - "version": "0.15.7", + "version": "0.15.8", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", - "version": "3.6.0", "url": "https://r-project.org" }, - "runtimePlatform": "R Under development (unstable) (2019-03-20 r76254)", + "runtimePlatform": "R version 4.0.3 (2020-10-10)", "author": [ { "@type": "Organization", "name": "Greg Finak", - "email": "gfinak@fredhutch.org" + "email": "greg.finak@gmail.com" } ], "contributor": [ @@ -32,21 +31,36 @@ }, { "@type": "Organization", - "name": "Ellis Hughes" + "name": "Ellis Hughes", + "email": "ehhughes@scharp.org" + }, + { + "@type": "Organization", + "name": "Jimmy Fulp", + "email": "wfulp@scharp.org" + }, + { + "@type": "Organization", + "name": "Marie Vendettuoli", + "email": "mvendett@scharp.org" + }, + { + "@type": "Organization", + "name": "Jason Taylor" } ], "copyrightHolder": [ { "@type": "Organization", "name": "Greg Finak", - "email": "gfinak@fredhutch.org" + "email": "greg.finak@gmail.com" } ], "maintainer": [ { "@type": "Organization", - "name": "Greg Finak", - "email": "gfinak@fredhutch.org" + "name": "Ellis Hughes", + "email": "ehhughes@scharp.org" } ], "softwareSuggestions": [ @@ -287,17 +301,13 @@ } ], "releaseNotes": "https://github.com/ropensci/DataPackageR/blob/master/NEWS.md", - "readme": "https://github.com/ropensci/DataPackageR/blob/master/README.md", - "contIntegration": [ - "https://travis-ci.org/ropensci/DataPackageR", - "https://codecov.io/github/ropensci/DataPackageR?branch=master", - "https://ci.appveyor.com/project/RGLab/DataPackageR" - ], + "readme": "https://github.com/ropensci/DataPackageR/blob/main/README.md", + "contIntegration": "https://codecov.io/github/ropensci/DataPackageR?branch=master", "developmentStatus": "https://www.repostatus.org/#active", "review": { "@type": "Review", - "url": "https://github.com/ropensci/onboarding/issues/230", - "provider": "http://ropensci.org" + "url": "https://github.com/ropensci/software-review/issues/230", + "provider": "https://ropensci.org" }, "provider": { "@id": "https://cran.r-project.org", @@ -305,7 +315,7 @@ "name": "Comprehensive R Archive Network (CRAN)", "url": "https://cran.r-project.org" }, - "relatedLink": "https://CRAN.R-project.org/package=DataPackageR", + "relatedLink": ["https://CRAN.R-project.org/package=DataPackageR", "https://docs.ropensci.org/DataPackageR/"], "keywords": [ "r", "r-package", @@ -313,5 +323,6 @@ "rstats", "peer-reviewed" ], - "funder": {} + "funder": {}, + "fileSize": "1356.682KB" } diff --git a/cran-comments.md b/cran-comments.md index b4d5e56..7f654f9 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,27 +1,42 @@ ## Submission 0.15.8 -* Fix a test associated with usethis 1.5.1.9000 +* Fix tests that were failing. This should resolve the failures identified by CRAN +* Change maintainer to Ellis Hughes from Greg Finak +* update filepaths/URLS based on request from CRAN ## Test environments -* Local linux (x86_64-pc-linux-gnu), R 3.6.1 (2019-07-05) -* Local rhub docker (rhub/ubuntu-gcc-devel) -* Local rhub docker (rhub/ubuntu-gcc-release) -* Local rhub docker (rhub/ubuntu-rchk) -* Windows 10 enterprise v1607 14393.2906 (R 4.0.0 2020-04-09 v78186) -* rhub macOS 10.11 El Capitan, R-release (experimental) -* rhub fedora-gcc-devel +* local R installation, R 4.0.3 +* github actions/ windows-latest - R Release +* github actions/ macOS-latest - R Release +* github actions/ ubuntu-20.04 - R Release +* github actions/ ubuntu-20.04 - R devel +* github actions/ ubuntu-20.04 - R 3.6 +* github actions/ ubuntu-20.04 - R 3.5 +* rhub/windows-x86_64- R devel +* rhub/ubuntu-gcc - R release +* rhub/fedora-clang - R devel +* win-builder (devel) + ## R CMD check results There were no ERRORs or WARNINGs -One NOTE -─ checking CRAN incoming feasibility ... Note_to_CRAN_maintainers (1.4s) - Maintainer: 'Greg Finak ' +One NOTE: + +Maintainer: 'Ellis Hughes ' + +New submission + +Package was archived on CRAN + +CRAN repository db overrides: + X-CRAN-Comment: Archived on 2020-04-25 as check problems were not + corrected in time. -On rhub/fedora-gcc-devel one test fails because the texlive-framed package is not installed and is needed for rmarkdown. +This package was archived earlier due to not resolving check errors. With this +upload, this should resolve any errors. -I observe two test failures on rhub windows systems that I am unable to reproduce on windows systems I have avaialble to me with R 4.0.0. ## Downstream dependencies diff --git a/tests/testthat/test-document.R b/tests/testthat/test-document.R index 37d4884..e9b0f75 100644 --- a/tests/testthat/test-document.R +++ b/tests/testthat/test-document.R @@ -10,11 +10,13 @@ test_that("documentation is built via document()", { force = TRUE, r_object_names = "cars_over_20" ) - package_build( - file.path(tempdir(), "subsetCars") - ) - dir.create(file.path(tempdir(),"lib")) - expect_true(document(file.path(tempdir(), "subsetCars"), lib = file.path(tempdir(),"lib"))) + + temp_libpath <- file.path(tempdir(), "lib") + dir.create(temp_libpath) + + package_build(file.path(tempdir(), "subsetCars")) + + expect_true(document(file.path(tempdir(), "subsetCars"), lib = temp_libpath)) docfile <- readLines(file.path( tempdir(), "subsetCars", "data-raw", "documentation.R" @@ -45,10 +47,10 @@ test_that("documentation is built via document()", { flush(connection) close(connection) expect_output( - document(file.path(tempdir(), "subsetCars"), lib = file.path(tempdir(),"lib")), + document(file.path(tempdir(), "subsetCars"), lib = temp_libpath), "Writing testmarkdownroxygen.Rd" ) - v <- vignette(package = "subsetCars", lib.loc = file.path(tempdir(),"lib")) + v <- vignette(package = "subsetCars", lib.loc = temp_libpath) expect_equal(v$results[, "Item"], "subsetCars") unlink(file.path(tempdir(), "subsetCars"), recursive = TRUE, diff --git a/tests/testthat/test-edge-cases.R b/tests/testthat/test-edge-cases.R index c67ce25..30e6be0 100644 --- a/tests/testthat/test-edge-cases.R +++ b/tests/testthat/test-edge-cases.R @@ -115,6 +115,7 @@ test_that("package built in different edge cases", { recursive = TRUE, force = TRUE ) + setwd(old) yml <- DataPackageR:::construct_yml_config("foo.Rmd") expect_true(yml_enable_compile( diff --git a/tests/testthat/test-news-update.R b/tests/testthat/test-news-update.R index d86d5fa..52eadcf 100644 --- a/tests/testthat/test-news-update.R +++ b/tests/testthat/test-news-update.R @@ -10,11 +10,12 @@ test_that("news file is created", { force = TRUE, r_object_names = c("cars_over_20") ) + options(DataPackageR_interact = FALSE) package_build(file.path(tempdir(), "subsetCars")) expect_equal(readLines(file.path(tempdir(), "subsetCars", "NEWS.md"))[3], "Package built in non-interactive mode") # nolint unlink(file.path(tempdir(), "subsetCars"), recursive = TRUE, force = TRUE ) - expect_equal(.prompt_user_for_change_description(), "Package built in non-interactive mode") # nolint + expect_equal(DataPackageR:::.prompt_user_for_change_description(interact = FALSE), "Package built in non-interactive mode") # nolint }) diff --git a/tests/testthat/test-r-processing.R b/tests/testthat/test-r-processing.R index ecf72e4..96e2e36 100644 --- a/tests/testthat/test-r-processing.R +++ b/tests/testthat/test-r-processing.R @@ -1,9 +1,10 @@ context("R file script processing to vignette") test_that("R file processing works and creates vignettes", { + file <- system.file("extdata", "tests", "rfileTest.R", package = "DataPackageR" ) - dir.create(file.path(tempdir(),"lib")) + datapackage_skeleton( name = "rfiletest", path = tempdir(), @@ -11,24 +12,28 @@ test_that("R file processing works and creates vignettes", { force = TRUE, r_object_names = "data" ) + + temp_libpath <- file.path(tempdir(),"lib") + dir.create(temp_libpath) + expect_equal( - basename( - package_build( - file.path(tempdir(), "rfiletest"), - install = TRUE, - lib = file.path(tempdir(),"lib") - ) - ), + basename(package_build( + file.path(tempdir(), "rfiletest"), + install = TRUE, + lib = temp_libpath + )), "rfiletest_1.0.tar.gz" ) - v <- vignette(package = "rfiletest", lib.loc = file.path(tempdir(),"lib")) + + v <- vignette(package = "rfiletest", lib.loc = temp_libpath) + expect_equal(v$results[, "Item"], "rfileTest") expect_true(file_test("-f", file.path(tempdir(),"rfiletest","inst","doc","rfileTest.pdf"))) unlink(file.path(tempdir(), "rfiletest"), recursive = TRUE, force = TRUE ) - remove.packages("rfiletest", lib = file.path(tempdir(),"lib")) + remove.packages("rfiletest", lib = temp_libpath) file <- system.file("extdata", "tests", "rfileTest_noheader.R", package = "DataPackageR" ) @@ -39,23 +44,23 @@ test_that("R file processing works and creates vignettes", { force = TRUE, r_object_names = "data" ) - dir.create(file.path(tempdir(),"lib")) + dir.create(temp_libpath) expect_equal( basename( package_build( file.path(tempdir(), "rfiletest"), install = TRUE, - lib = file.path(tempdir(),"lib") + lib = temp_libpath ) ), "rfiletest_1.0.tar.gz" ) - v <- vignette(package = "rfiletest", lib.loc = file.path(tempdir(),"lib")) + v <- vignette(package = "rfiletest", lib.loc = temp_libpath) expect_equal(v$results[, "Item"], "rfileTest_noheader") unlink(file.path(tempdir(), "rfiletest"), recursive = TRUE, force = TRUE ) try(usethis::proj_set(NULL),silent = TRUE) #wrap in try for usethis 1.4 vs 1.5 - remove.packages("rfiletest",lib = file.path(tempdir(),"lib")) + remove.packages("rfiletest",lib = temp_libpath) }) diff --git a/tests/testthat/test-updating-datapackager-version.R b/tests/testthat/test-updating-datapackager-version.R index f0da712..20171dc 100644 --- a/tests/testthat/test-updating-datapackager-version.R +++ b/tests/testthat/test-updating-datapackager-version.R @@ -1,6 +1,6 @@ context("updating datapackager API version") test_that("can update", { - + #setup, build example package file <- system.file("extdata", "tests", "subsetCars.Rmd", package = "DataPackageR" @@ -18,16 +18,16 @@ test_that("can update", { ) ) package_build(file.path(tempdir(), "subsetCars")) - + #remove news.md and modify with the digest so it thinks there has been an update when rebuilt file.remove(file.path(tempdir(),"subsetCars","news.md")) - oldDigest<-.parse_data_digest(file.path(tempdir(),"subsetCars")) + oldDigest<-DataPackageR:::.parse_data_digest(file.path(tempdir(),"subsetCars")) oldDigest$cars_over_20<-"123456789" DataPackageR:::.save_digest(oldDigest,file.path(tempdir(),"subsetCars")) - + expect_identical( try(package_build(file.path(tempdir(), "subsetCars"))), normalizePath(file.path(tempdir(),"subsetCars_1.0.tar.gz"),winslash = "/") )#if it passes, it returns the path to the tar file? - -}) \ No newline at end of file + +}) diff --git a/vignettes/YAML_CONFIG.Rmd b/vignettes/YAML_CONFIG.Rmd index 31d0a79..45f156f 100644 --- a/vignettes/YAML_CONFIG.Rmd +++ b/vignettes/YAML_CONFIG.Rmd @@ -8,7 +8,7 @@ output: toc: yes bibliography: bibliography.bib vignette: > - %\VignetteIndexEntry{DataPackageR YAML configuration.} + %\VignetteIndexEntry{The DataPackageR YAML configuration file.} %\VignetteEngine{knitr::rmarkdown} %\usepackage[utf8]{inputenc} %\usepackage{graphicx} @@ -216,4 +216,4 @@ yml_write(yml_oneobj, path = "path_to_package") ``` The `yml_oneobj` read by `yml_find()` carries an attribute -that is the path to the package. The user doesn't need to pass a `path` to `yml_write` if the config has been read by `yml_find`. \ No newline at end of file +that is the path to the package. The user doesn't need to pass a `path` to `yml_write` if the config has been read by `yml_find`. diff --git a/vignettes/usingDataPackageR.Rmd b/vignettes/usingDataPackageR.Rmd index 14571ab..7cf06fe 100644 --- a/vignettes/usingDataPackageR.Rmd +++ b/vignettes/usingDataPackageR.Rmd @@ -35,7 +35,7 @@ In this vignette we will subset and package the `mtcars` data set. ## Set up a new data package. -We'll set up a new data package based on `mtcars` example in the [README](https://github.com/RGLab/DataPackageR/blob/master/README.md). +We'll set up a new data package based on `mtcars` example in the [README](https://github.com/ropensci/DataPackageR/blob/master/README.md). The `datapackage_skeleton()` API is used to set up a new package. The user needs to provide: @@ -117,7 +117,7 @@ The objects must be listed in the yaml configuration file. `datapackage_skeleton DataPackageR provides an API for modifying this file, so it does not need to be done by hand. -Further information on the contents of the YAML configuration file, and the API are in the [YAML Configuration Details](YAML_CONFIG.md) +Further information on the contents of the YAML configuration file, and the API are in the [YAML Configuration Details](YAML_CONFIG.html) ### Where do I put my raw datasets? @@ -298,7 +298,7 @@ assert_data_version(data_package_name = "mtcars20", Version 1.12.0 has moved away from controlling the build process using `datasets.R` and an additional `masterfile` argument. -The build process is now controlled via a `datapackager.yml` configuration file located in the package root directory. (see [YAML Configuration Details](YAML_CONFIG.md)) +The build process is now controlled via a `datapackager.yml` configuration file located in the package root directory. (see [YAML Configuration Details](YAML_CONFIG.html)) ### Create a datapackager.yml file @@ -413,7 +413,7 @@ You now have a data package source tree. This will let you version control your data processing code, and provide a mechanism for sharing your package with others. -For more details on using git and github with R, there is an excellent guide provided by Jenny Bryan: [Happy Git and GitHub for the useR](http://happygitwithr.com/) and Hadley Wickham's [book on R packages](http://r-pkgs.had.co.nz/). +For more details on using git and github with R, there is an excellent guide provided by Jenny Bryan: [Happy Git and GitHub for the useR](https://happygitwithr.com/) and Hadley Wickham's [book on R packages]( https://r-pkgs.org/). # Additional Details