Skip to content

Commit

Permalink
Merge pull request #8 from OuhscBbmc/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
wibeasley authored Sep 7, 2018
2 parents de95a94 + eb3e35d commit c2fa696
Show file tree
Hide file tree
Showing 22 changed files with 773 additions and 1,339 deletions.
19 changes: 8 additions & 11 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Package: codified
Title: Produce standard/formalized demographics tables
Title: Produce Standard/Formalized Demographics Tables
Description: Augment clinical data with metadata to create
output used in conventional publications and reports.
Version: 0.1.1.9001
Date: 2018-08-27
Version: 0.2.0
Date: 2018-09-06
Authors@R: c(person("Will", "Beasley", role = c("aut", "cre"), email =
"wibeasley@hotmail.com", comment = c(ORCID = "0000-0002-5613-5006")),
person("Peter", "Higgins", role = "ctb"))
Expand All @@ -13,24 +13,21 @@ Depends:
R(>= 3.0.0),
stats
Imports:
checkmate (>= 1.8.4),
dplyr (>= 0.7.0),
kableExtra,
knitr (>= 1.18.0),
magrittr,
methods,
readr (>= 1.2.0),
readr (>= 1.1.0),
rlang,
tibble (>= 1.4.0),
tidyr (>= 0.7.0)
Suggests:
checkmate (>= 1.8.4),
devtools,
kableExtra,
knitr (>= 1.18.0),
REDCapR,
rmarkdown,
sessioninfo,
testthat (>= 0.9)
Remotes:
github::tidyverse/readr
testthat (>= 2.0)
License: MIT + file LICENSE
LazyData: TRUE
VignetteBuilder: knitr
Expand Down
8 changes: 6 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# codified 0.0.1.9001

* Added a `NEWS.md` file to track changes to the package.
# codified 0.2.0

* added `table_nih_enrollment()` and `table_nih_enrollment_pretty()`. #2
* added `nih-enrollment-html` vignette. #6
* started pkgdown site. #7
* the idea was created by [Peter Higgins](http://www.med.umich.edu/higginslab/) (@higgi13425) for [R/Medicine 2018](http://r-medicine.com/).
2 changes: 1 addition & 1 deletion R/table-nih-enrollment.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' @name table_nih_enrollment
#' @aliases table_nih_enrollment table_nih_enrollment_pretty
#'
#' @title Produce an NIH-compliant enrolment table.
#' @title Produce an NIH-compliant enrollment table.
#'
#' @description Produce an NIH enrollment table, leveraging metadata to adapt to the observed [data.frame].
#'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ devtools::install_github(repo="OuhscBbmc/codified")

In the future, the *release* version can be installed from [CRAN](https://cran.r-project.org/package=codified).
```r
# install.packages("codified") # Not yet on CRAN.
install.packages("codified")
```

The package can be uninstalled from your local machine with `remove.packages("codified")`.
Expand Down
31 changes: 31 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Description
-----------------------------------------------
This is a new release.

Thank you for taking the time to review my submission, and please tell me if there's something else I should do for CRAN. -Will Beasley


Test environments
-----------------------------------------------

The win-builder and a local machine have used the CRAN version of dplyr. The others have used the current GitHub master version of dplyr.

* Local Ubuntu, R 3.5.1 patched
* [win-builder](https://win-builder.r-project.org/9fyA0Vz5XQNU/) (version="R-devel")
* [Travis CI](https://travis-ci.org/OuhscBbmc/codified), Ubuntu LTS
* [AppVeyor](https://ci.appveyor.com/project/wibeasley/codified), Windows Server


R CMD check results
-----------------------------------------------

* No ERRORs or WARNINGs on any builds.

* No NOTEs other than 'New submission'


Downstream dependencies
-----------------------------------------------

No other packages depend/import this one.

2 changes: 1 addition & 1 deletion docs/CODE_OF_CONDUCT.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

101 changes: 61 additions & 40 deletions docs/articles/nih-enrollment-html.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 16 additions & 9 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion docs/reference/codified-package.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/table_nih_enrollment.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions documentation-for-developers/refresh.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ test_results_checked <- devtools::test()
test_results_checked <- devtools::test(filter = "table-nih-enrollment")
# testthat::test_dir("./tests/")
test_results_not_checked <- testthat::test_dir("./tests/manual/")

# devtools::check(force_suggests = FALSE)
# devtools::build_win(version="R-devel") #CRAN submission policies encourage the development version
# devtools::revdep_check(pkg="codified", recursive=TRUE)
# devtools::release(check=FALSE) #Careful, the last question ultimately uploads it to CRAN, where you can't delete/reverse your decision.
26 changes: 20 additions & 6 deletions inst/doc/nih-enrollment-html.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,26 @@ if( !requireNamespace("REDCapR", quietly=T) )
library(REDCapR)

## ----redcap-establish----------------------------------------------------
ds_2 <- REDCapR::redcap_read_oneshot(
redcap_uri = "https://bbmc.ouhsc.edu/redcap/api/", # URL of REDCap Server.
token = "F304DEC3793FECC3B6DEEFF66302CAD3", # User-speciifc token/password.
guess_type = FALSE # Keep all variables as strings/characters.
)$data
if( !requireNamespace("REDCapR", quietly=TRUE) ) {
ds <- ds_2 # If REDCapR isn't installed, use the previous version of the dataset.
} else if( "0.9.8" < packageVersion("REDCapR") ) {
ds_2 <- REDCapR::redcap_read_oneshot(
redcap_uri = "https://bbmc.ouhsc.edu/redcap/api/", # URL of REDCap Server.
token = "F304DEC3793FECC3B6DEEFF66302CAD3", # User-specific token/password.
guess_type = FALSE # Keep all variables as strings/characters.
)$data
} else {
# Older versions of REDCapR don't have the `guess_type` parameter
ds_2 <- REDCapR::redcap_read_oneshot(
redcap_uri = "https://bbmc.ouhsc.edu/redcap/api/", # URL of REDCap Server.
token = "F304DEC3793FECC3B6DEEFF66302CAD3" # User-specific token/password.
)$data %>%
dplyr::mutate(
gender = as.character(gender),
race = as.character(race),
ethnicity = as.character(ethnicity)
)
}

## ----redcap-local-cosmetically-format------------------------------------
table_nih_enrollment_pretty(
Expand Down Expand Up @@ -129,4 +144,3 @@ table_nih_enrollment_pretty(
d_lu_race = ds_lu_race_3
)


34 changes: 29 additions & 5 deletions inst/doc/nih-enrollment-html.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,38 @@ if( !requireNamespace("REDCapR", quietly=T) )
library(REDCapR)
```

Next, download the data from the REDCap database into the `ds_2` data.frame.
Next, download the data from the REDCap database into the `ds_2` data.frame. If you're running the most recent version of REDCapR (available on GitHub), the code will be:

```{r redcap-establish}
```r
ds_2 <- REDCapR::redcap_read_oneshot(
redcap_uri = "https://bbmc.ouhsc.edu/redcap/api/", # URL of REDCap Server.
token = "F304DEC3793FECC3B6DEEFF66302CAD3", # User-speciifc token/password.
token = "F304DEC3793FECC3B6DEEFF66302CAD3", # User-specific token/password.
guess_type = FALSE # Keep all variables as strings/characters.
)$data
)$data
```
The following code is more complicated than normal, because the vignette has to account for different versions of REDCapR being installed on the machine.

```{r redcap-establish}
if( !requireNamespace("REDCapR", quietly=TRUE) ) {
ds <- ds_2 # If REDCapR isn't installed, use the previous version of the dataset.
} else if( "0.9.8" < packageVersion("REDCapR") ) {
ds_2 <- REDCapR::redcap_read_oneshot(
redcap_uri = "https://bbmc.ouhsc.edu/redcap/api/", # URL of REDCap Server.
token = "F304DEC3793FECC3B6DEEFF66302CAD3", # User-specific token/password.
guess_type = FALSE # Keep all variables as strings/characters.
)$data
} else {
# Older versions of REDCapR don't have the `guess_type` parameter
ds_2 <- REDCapR::redcap_read_oneshot(
redcap_uri = "https://bbmc.ouhsc.edu/redcap/api/", # URL of REDCap Server.
token = "F304DEC3793FECC3B6DEEFF66302CAD3" # User-specific token/password.
)$data %>%
dplyr::mutate(
gender = as.character(gender),
race = as.character(race),
ethnicity = as.character(ethnicity)
)
}
```


Expand Down Expand Up @@ -195,8 +219,8 @@ table_nih_enrollment_pretty(
d = ds_3,
d_lu_race = ds_lu_race_3
)
```

Feedback Welcome
=====================================================

Expand Down
Loading

0 comments on commit c2fa696

Please sign in to comment.