Skip to content

Commit

Permalink
Merge pull request #346 from OuhscBbmc/dev
Browse files Browse the repository at this point in the history
submit to CRAN; especially with changes of readr 2.0
  • Loading branch information
wibeasley authored Jul 22, 2021
2 parents aeeae25 + 244a46d commit 9f6b4ae
Show file tree
Hide file tree
Showing 65 changed files with 308 additions and 175 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ utility/
^CRAN-RELEASE$
^codecov\.yml$
^pkgdown$
^LICENSE\.md$
14 changes: 13 additions & 1 deletion .github/workflows/check-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1

- uses: r-lib/actions/setup-pandoc@master
Expand Down Expand Up @@ -53,11 +54,22 @@ jobs:
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
2 changes: 1 addition & 1 deletion CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ opening an issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the Contributor Covenant
(http:contributor-covenant.org), version 1.0.0, available at
http://contributor-covenant.org/version/1/0/0/
https://contributor-covenant.org/version/1/0/0/
7 changes: 3 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Description: Encapsulates functions to streamline calls from R to the REDCap
University. The Application Programming Interface (API) offers an avenue
to access and modify data programmatically, improving the capacity for
literate and reproducible programming.
Version: 0.11.1.9005
Version: 1.0.0
Authors@R: c(person("Will", "Beasley", role = c("aut", "cre"), email =
"[email protected]", comment = c(ORCID = "0000-0002-5613-5006")),
person("David", "Bard", role = "ctb"),
Expand All @@ -20,7 +20,7 @@ Authors@R: c(person("Will", "Beasley", role = c("aut", "cre"), email =
comment = c(ORCID = '0000-0002-3386-6076')), person("Felix", "Torres",
role = "ctb", email = "[email protected]"), person("Philip", "Chase",
role = "ctb", email = "[email protected]"))
URL: https://ouhscbbmc.github.io/REDCapR, https://github.com/OuhscBbmc/REDCapR, http://ouhsc.edu/bbmc/, http://project-redcap.org
URL: https://ouhscbbmc.github.io/REDCapR/, https://github.com/OuhscBbmc/REDCapR, https://www.ouhsc.edu/bbmc/, https://project-redcap.org
BugReports: https://github.com/OuhscBbmc/REDCapR/issues
Depends:
R(>= 3.5.0)
Expand All @@ -43,8 +43,7 @@ Suggests:
rmarkdown (>= 2.0),
sessioninfo (>= 1.1.1),
testthat (>= 3.0)
License: GPL-2
LazyData: TRUE
License: MIT + file LICENSE
VignetteBuilder: knitr
Encoding: UTF-8
RoxygenNote: 7.1.1
Expand Down
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2021
COPYRIGHT HOLDER: REDCapR authors
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2021 REDCapR authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
13 changes: 8 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ Upcoming Versions
In the future:
...

Version 0.12 (Unreleased on CRAN)
Version 1.0 (released 2021-07-21)
==========================================================

The package has been stable for years and should be reflected in the major version number.

### Minor Enhancements

* When writing records to the server, the functions `redcap_write()` and `redcap_write_oneshot()` have a new parameter that converts R's `logical`/boolean columns to integers. This meshes well with T/F and Y/N items that are coded as 1/0 underneath. The default will be FALSE (ie, the integers are not converted by default), so it doesn't break existing code. (#305)
Expand All @@ -20,7 +22,8 @@ Version 0.12 (Unreleased on CRAN)
### Stability Features

* update for newer version of testthat -v3.0.0 (#312)
* update for newer version of readr (#313)
* update for newer version of readr 2.0.0 (#343)
* update for newer version of readr 1.4.0 (#313)
* update for newer version of REDCap on test server (#310)
* save expected datasets as files -instead of included in the actual test code (#308)

Expand Down Expand Up @@ -127,7 +130,7 @@ Versions 0.9.7 (Released 2017-09-09)
* Remove line breaks from token (Thanks @haozhu233 in issues #103 & #104)

### Minor Updates
* When combining batches into a single data.frame, `data.table::rbindlist()` is used. This should prevent errors with the first batch's data type (for a column) isn't compatible with a later batch. For instance, this occurs when the first batch has only integers for `record_id`, but a subsequent batch has values like `aa-test-aa`. The variable for the combined dataset should be a character. (Issue #128 & http://stackoverflow.com/questions/39377370/bind-rows-of-different-data-types; Thanks @arunsrinivasan)
* When combining batches into a single data.frame, `data.table::rbindlist()` is used. This should prevent errors with the first batch's data type (for a column) isn't compatible with a later batch. For instance, this occurs when the first batch has only integers for `record_id`, but a subsequent batch has values like `aa-test-aa`. The variable for the combined dataset should be a character. (Issue #128 & https://stackoverflow.com/questions/39377370/bind-rows-of-different-data-types; Thanks @arunsrinivasan)
* Uses the `dplyr` package instead of `plyr`. This shouldn't affect callers, because immediately before returning the data, `REDCapR::redcap_read()` coerces the `tibble::tibble` (which was formerly called `dplyr::tbl_df`) back to a vanilla `data.frame` with `as.data.frame()`.
* A few more instances of validating input parameters to read functions. (Issue #8).

Expand Down Expand Up @@ -193,7 +196,7 @@ Version 0.4-28 (Released 2014-09-20)

### Updates
* By default, the SSL certs come from the httr package. However, REDCapR will continue to maintain a copy in case httr's version on CRAN gets out of date.
* The tests are split into two collections: one that's run by the CRAN checks, and the other run manually. [Thanks, Gabor Csardi](http://stackoverflow.com/questions/25595487/testthat-pattern-for-long-running-tests). Any test with a dependency outside the package code (especially the REDCap test projects) is run manually so changes to the test databases won't affect the success of building the previous version on CRAN.
* The tests are split into two collections: one that's run by the CRAN checks, and the other run manually. [Thanks, Gabor Csardi](https://stackoverflow.com/questions/25595487/testthat-pattern-for-long-running-tests). Any test with a dependency outside the package code (especially the REDCap test projects) is run manually so changes to the test databases won't affect the success of building the previous version on CRAN.
* Corrected typo in `redcap_download_file_oneshot()` documentation, thanks to Andrew Peters (@ARPeters #45).


Expand All @@ -220,7 +223,7 @@ Version 0.2 (Released 2014-07-02)
* The `redcap_project()` object reduces repeatedly passing parameters like the server URL, the user token, and the SSL cert location.

### Updates
* New Mozilla SSL Certification Bundles released on cURL (released 2013-12-05; http://curl.haxx.se/ca/cacert.pem)
* New Mozilla SSL Certification Bundles released on cURL (released 2013-12-05)
* Renamed `redcap_read_batch()` to `redcap_read()`. These changes reflect our suggestion that reads should typically be batched.
* Renamed `redcap_read()` to `redcap_read_oneshot()`
* Renamed `redcap_write()` to `redcap_write_oneshot()` (which is an internal function).
Expand Down
20 changes: 10 additions & 10 deletions R/REDCapR-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @aliases REDCapR
#'
#' @title R utilities for interacting with a REDCap data system
#' <http://www.project-redcap.org/>
#' <https://www.project-redcap.org/>
#'
#' @description
#'
Expand All @@ -14,28 +14,28 @@
#' following projects. We appreciate the support.
#' * *OUHSC CCAN Independent Evaluation of the State of Oklahoma Competitive
#' Maternal, Infant, and Early Childhood Home Visiting
#' ([MIECHV](http://mchb.hrsa.gov/programs/homevisiting/)) Project*.
#' [HRSA/ACF D89MC23154](https://grants6.hrsa.gov/MCHB/DGISReports/Abstract/AbstractDetails.aspx?cbAbstractSummary=D89MC23154_2012_NonResearch_4).
#' ([MIECHV](https://mchb.hrsa.gov/maternal-child-health-initiatives/home-visiting-overview)) Project*.
#' HRSA/ACF D89MC23154.
#' David Bard, PI, OUHSC; 2011-2015.
#' * *Independent Evaluation of the State of OK MIECHV Evidence Based Home
#' Visitation Project*, [NIH](https://www.nih.gov/)-sponsored collaboration
#' with [OSDH](https://ok.gov/health/).
#' with [OSDH](https://oklahoma.gov/health.html).
#' David Bard, PI, OUHSC; 2015-2017.
#' * *OSDH ParentPRO Pilot Evaluation*, federally-sponsored collaboration
#' with [OSDH](https://ok.gov/health/).
#' with [OSDH](https://oklahoma.gov/health.html).
#' David Bard, PI, OUHSC; 2015-2017.
#' * *Title IV-E Waiver Project*, [HRSA/MCHB](http://mchb.hrsa.gov/)-sponsored
#' collaboration with [OKDHS](http://www.okdhs.org/);
#' * *Title IV-E Waiver Project*, [HRSA/MCHB](https://mchb.hrsa.gov/)-sponsored
#' collaboration with [OKDHS](https://oklahoma.gov/okdhs.html);
#' David Bard, PI, OUHSC; 2014-2017.
#' * *Integrative Analysis of Longitudinal Studies of Aging (IALSA)*,
#' sponsored by [NIH 5P01AG043362](http://grantome.com/grant/NIH/P01-AG043362).
#' sponsored by [NIH 5P01AG043362](https://grantome.com/grant/NIH/P01-AG043362).
#' Scott Hofer, PI, University of Victoria;
#' Will Beasley, PI of site-award, OUHSC; 2013-2018.
#' * *Oklahoma Shared Clinical and Translational Resources*, sponsored by
#' [NIH NIGMS; U54 GM104938](http://grantome.com/grant/NIH/U54-GM104938).
#' [NIH NIGMS; U54 GM104938](https://grantome.com/grant/NIH/U54-GM104938).
#' Judith A. James, PI, OUHSC; 2013-2018.
#' * Additional Institutional Support from OUHSC
#' [Dept of Pediatrics](https://www.oumedicine.com/department-of-pediatrics);
#' [Dept of Pediatrics](https://medicine.ouhsc.edu/Academic-Departments/Pediatrics);
#' 2013-2017.
#'
#'
Expand Down
2 changes: 1 addition & 1 deletion R/redcap-download-file-oneshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#' * `success`: A boolean value indicating if the operation was apparently
#' successful.
#' * `status_code`: The
#' [http status code](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' [http status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' of the operation.
#' * `outcome_message`: A human readable string indicating the operation's
#' outcome.
Expand Down
2 changes: 1 addition & 1 deletion R/redcap-download-instrument.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#' * `success`: A boolean value indicating if the operation was apparently
#' successful.
#' * `status_code`: The
#' [http status code](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' [http status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' of the operation.
#' * `outcome_message`: A human readable string indicating the operation's
#' outcome.
Expand Down
2 changes: 1 addition & 1 deletion R/redcap-metadata-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#' * `success`: A boolean value indicating if the operation was apparently
#' successful.
#' * `status_codes`: A collection of
#' [http status codes](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes),
#' [http status codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes),
#' separated by semicolons. There is one code for each batch attempted.
#' * `outcome_messages`: A collection of human readable strings indicating the
#' operations' semicolons. There is one code for each batch attempted. In an
Expand Down
4 changes: 2 additions & 2 deletions R/redcap-metadata-write.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' * `success`: A boolean value indicating if the operation was apparently
#' successful.
#' * `status_code`: The
#' [http status code](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' [http status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' of the operation.
#' * `outcome_message`: A human readable string indicating the operation's
#' outcome.
Expand Down Expand Up @@ -73,7 +73,7 @@ redcap_metadata_write <- function(
verbose = TRUE,
config_options = NULL
) {
csv_elements <- NULL #This prevents the R CHECK NOTE: 'No visible binding for global variable Note in R CMD check'; Also see if( getRversion() >= "2.15.1" ) utils::globalVariables(names=c("csv_elements")) #http://stackoverflow.com/questions/8096313/no-visible-binding-for-global-variable-note-in-r-cmd-check; http://stackoverflow.com/questions/9439256/how-can-i-handle-r-cmd-check-no-visible-binding-for-global-variable-notes-when
csv_elements <- NULL #This prevents the R CHECK NOTE: 'No visible binding for global variable Note in R CMD check'; Also see if( getRversion() >= "2.15.1" ) utils::globalVariables(names=c("csv_elements")) #https://stackoverflow.com/questions/8096313/no-visible-binding-for-global-variable-note-in-r-cmd-check; https://stackoverflow.com/questions/9439256/how-can-i-handle-r-cmd-check-no-visible-binding-for-global-variable-notes-when

checkmate::assert_character(redcap_uri, any.missing = FALSE, len = 1, pattern = "^.{1,}$")
checkmate::assert_character(token , any.missing = FALSE, len = 1, pattern = "^.{1,}$")
Expand Down
4 changes: 2 additions & 2 deletions R/redcap-project.R
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,5 @@ redcap_project <- setRefClass(
) #End methods list
) #End class

# http://adv-r.had.co.nz/OO-essentials.html # nolint
# http://stackoverflow.com/questions/21875596/mapping-a-c-sharp-class-definition-to-an-r-reference-class-definition # nolint
# https://adv-r.had.co.nz/OO-essentials.html # nolint
# https://stackoverflow.com/questions/21875596/mapping-a-c-sharp-class-definition-to-an-r-reference-class-definition # nolint
2 changes: 1 addition & 1 deletion R/redcap-read-oneshot-eav.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#' * `success`: A boolean value indicating if the operation was apparently
#' successful.
#' * `status_code`: The
#' [http status code](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' [http status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' of the operation.
#' * `outcome_message`: A human readable string indicating the operation's
#' outcome.
Expand Down
2 changes: 1 addition & 1 deletion R/redcap-read-oneshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
#' * `success`: A boolean value indicating if the operation was apparently
#' successful.
#' * `status_code`: The
#' [http status code](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' [http status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' of the operation.
#' * `outcome_message`: A human readable string indicating the operation's
#' outcome.
Expand Down
2 changes: 1 addition & 1 deletion R/redcap-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
#' * `success`: A boolean value indicating if the operation was apparently
#' successful.
#' * `status_codes`: A collection of
#' [http status codes](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes),
#' [http status codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes),
#' separated by semicolons. There is one code for each batch attempted.
#' * `outcome_messages`: A collection of human readable strings indicating the
#' operations' semicolons. There is one code for each batch attempted. In an
Expand Down
2 changes: 1 addition & 1 deletion R/redcap-report.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#' * `success`: A boolean value indicating if the operation was apparently
#' successful.
#' * `status_code`: The
#' [http status code](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' [http status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' of the operation.
#' * `outcome_message`: A human readable string indicating the operation's
#' outcome.
Expand Down
2 changes: 1 addition & 1 deletion R/redcap-survey-link-export-oneshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' * `success`: A boolean value indicating if the operation was apparently
#' successful.
#' * `status_code`: The
#' [http status code](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' [http status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' of the operation.
#' * `outcome_message`: A human readable string indicating the operation's
#' outcome.
Expand Down
2 changes: 1 addition & 1 deletion R/redcap-upload-file-oneshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' * `success`: A boolean value indicating if the operation was apparently
#' successful.
#' * `status_code`: The
#' [http status code](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' [http status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' of the operation.
#' * `outcome_message`: A human readable string indicating the operation's
#' outcome.
Expand Down
2 changes: 1 addition & 1 deletion R/redcap-variables.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' * `success`: A boolean value indicating if the operation was apparently
#' successful.
#' * `status_code`: The
#' [http status code](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' [http status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' of the operation.
#' * `outcome_message`: A human readable string indicating the operation's
#' outcome.
Expand Down
4 changes: 2 additions & 2 deletions R/redcap-write-oneshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#' * `success`: A boolean value indicating if the operation was apparently
#' successful.
#' * `status_code`: The
#' [http status code](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' [http status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' of the operation.
#' * `outcome_message`: A human readable string indicating the operation's
#' outcome.
Expand Down Expand Up @@ -97,7 +97,7 @@ redcap_write_oneshot <- function(
config_options = NULL
) {

csv_elements <- NULL #This prevents the R CHECK NOTE: 'No visible binding for global variable Note in R CMD check'; Also see if( getRversion() >= "2.15.1" ) utils::globalVariables(names=c("csv_elements")) #http://stackoverflow.com/questions/8096313/no-visible-binding-for-global-variable-note-in-r-cmd-check; http://stackoverflow.com/questions/9439256/how-can-i-handle-r-cmd-check-no-visible-binding-for-global-variable-notes-when
csv_elements <- NULL #This prevents the R CHECK NOTE: 'No visible binding for global variable Note in R CMD check'; Also see if( getRversion() >= "2.15.1" ) utils::globalVariables(names=c("csv_elements")) #https://stackoverflow.com/questions/8096313/no-visible-binding-for-global-variable-note-in-r-cmd-check; https://stackoverflow.com/questions/9439256/how-can-i-handle-r-cmd-check-no-visible-binding-for-global-variable-notes-when

checkmate::assert_character(redcap_uri, any.missing=FALSE, len=1, pattern="^.{1,}$")
checkmate::assert_character(token , any.missing=FALSE, len=1, pattern="^.{1,}$")
Expand Down
2 changes: 1 addition & 1 deletion R/redcap-write.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#' * `success`: A boolean value indicating if the operation was apparently
#' successful.
#' * `status_code`: The
#' [http status code](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' [http status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
#' of the operation.
#' * `outcome_message`: A human readable string indicating the operation's
#' outcome.
Expand Down
2 changes: 1 addition & 1 deletion R/retrieve-credential.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#' Defaults to FALSE.
#' @param check_token_pattern A `logical` value indicates if the token in the
#' credential file is a 32-character hexadecimal string. Defaults to FALSE.
#' @param dsn A [DSN](http://en.wikipedia.org/wiki/Data_source_name) on the
#' @param dsn A [DSN](https://en.wikipedia.org/wiki/Data_source_name) on the
#' local machine that points to the desired MSSQL database. Required.
#' @param channel An *optional* connection handle as returned by
#' [DBI::dbConnect()]. See Details below. Optional.
Expand Down
Loading

0 comments on commit 9f6b4ae

Please sign in to comment.