From 91eb677789be59c37beca5fc2311cd72dd626345 Mon Sep 17 00:00:00 2001 From: cjendres1 Date: Fri, 17 Feb 2023 09:07:18 -0500 Subject: [PATCH] Minor updates for CRAN submission --- .Rbuildignore | 1 + DESCRIPTION | 4 ++-- NEWS.md | 5 +++++ R/nhanes.R | 10 +++++----- man/nhanesCodebook.Rd | 4 ++-- man/nhanesDXA.Rd | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 91114bf..8d19d5c 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,2 +1,3 @@ ^.*\.Rproj$ ^\.Rproj\.user$ +^README.Rmd diff --git a/DESCRIPTION b/DESCRIPTION index 59fb9e8..61bbe2c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: nhanesA Version: 0.7.2 -Date: 2022-11-25 +Date: 2023-02-17 Title: NHANES Data Retrieval Authors@R: person(given = "Christopher", @@ -27,4 +27,4 @@ Suggests: knitr, rmarkdown VignetteBuilder: knitr -RoxygenNote: 7.2.1 +RoxygenNote: 7.2.3 diff --git a/NEWS.md b/NEWS.md index e2fa95d..e8d9fdb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +Version 0.7.2 +================================================================================ + +- Add includewithdrawn flag to nhanesSearchTableNames (thanks @Ifitrains https://github.com/cjendres1/nhanes/issues/15). Updated README. + Version 0.7.1 ================================================================================ diff --git a/R/nhanes.R b/R/nhanes.R index d7e61e1..f5e1a36 100644 --- a/R/nhanes.R +++ b/R/nhanes.R @@ -1,5 +1,5 @@ #nhanesA - retrieve data from the CDC NHANES repository -# Christopher J. Endres 09/18/2022 +# Christopher J. Endres 02/15/2023 # nhanesURL <- 'https://wwwn.cdc.gov/Nchs/Nhanes/' dataURL <- 'https://wwwn.cdc.gov/Nchs/Nhanes/search/DataPage.aspx' @@ -421,7 +421,7 @@ nhanes <- function(nh_table) { #' @examples #' \donttest{dxa_b <- nhanesDXA(2001)} #' \donttest{dxa_c_s <- nhanesDXA(2003, suppl=TRUE)} -#' \donttest{nhanesDXA(1999, destfile="dxx.xpt")} +#' \dontrun{nhanesDXA(1999, destfile="dxx.xpt")} #' @export nhanesDXA <- function(year, suppl=FALSE, destfile=NULL) { @@ -751,7 +751,7 @@ nhanesSearchTableNames <- function(pattern=NULL, ystart=NULL, ystop=NULL, includ if(nrow(df)==0) {return(NULL)} row.names(df) <- NULL if(details==TRUE){ - df$Data.File.Name <- str_sub(df$Data.File.Name, 1, nchar) + df$Data.File <- str_sub(df$Data.File, 1, nchar) return(df) } else { return(unlist(strsplit(df$Doc.File, " Doc"))) @@ -892,8 +892,8 @@ nhanesSearchVarName <- function(varname=NULL, ystart=NULL, ystop=NULL, includerd #' codebook information for the selected variable. #' @return The codebook is returned as a list object. Returns NULL upon error. #' @examples -#' nhanesCodebook('AUX_D', 'AUQ020D') -#' nhanesCodebook('BPX_J', 'BPACSZ') +#' \donttest{nhanesCodebook('AUX_D', 'AUQ020D')} +#' \donttest{nhanesCodebook('BPX_J', 'BPACSZ')} #' @export #' nhanesCodebook <- function(nh_table, colname, dxa=FALSE) { diff --git a/man/nhanesCodebook.Rd b/man/nhanesCodebook.Rd index 2b61ab9..622388c 100644 --- a/man/nhanesCodebook.Rd +++ b/man/nhanesCodebook.Rd @@ -26,6 +26,6 @@ as well as the distribution or range of values. This function returns the full codebook information for the selected variable. } \examples{ -nhanesCodebook('AUX_D', 'AUQ020D') -nhanesCodebook('BPX_J', 'BPACSZ') +\donttest{nhanesCodebook('AUX_D', 'AUQ020D')} +\donttest{nhanesCodebook('BPX_J', 'BPACSZ')} } diff --git a/man/nhanesDXA.Rd b/man/nhanesDXA.Rd index c47db1b..48c9faa 100644 --- a/man/nhanesDXA.Rd +++ b/man/nhanesDXA.Rd @@ -28,5 +28,5 @@ the data will be imported into the R environment. \examples{ \donttest{dxa_b <- nhanesDXA(2001)} \donttest{dxa_c_s <- nhanesDXA(2003, suppl=TRUE)} -\donttest{nhanesDXA(1999, destfile="dxx.xpt")} +\dontrun{nhanesDXA(1999, destfile="dxx.xpt")} }