From 2e6940b718df9adcfde6d9d26db47224bf146438 Mon Sep 17 00:00:00 2001 From: Dirk Schumacher Date: Fri, 22 Mar 2019 09:45:04 +0100 Subject: [PATCH] Address CRAN comments --- R/prevalence.R | 12 --------- cran-comments.md | 3 +-- docs/reference/anthro_prevalence.html | 37 +++++++++++++++++---------- man/anthro_prevalence.Rd | 12 --------- 4 files changed, 24 insertions(+), 40 deletions(-) diff --git a/R/prevalence.R b/R/prevalence.R index 9c008c5..2dc170f 100644 --- a/R/prevalence.R +++ b/R/prevalence.R @@ -56,7 +56,6 @@ #' for stratified analysis. #' #' @examples -#' \dontrun{ #' library(anthro) #' #' # compute the prevalence estimates for 100 random children @@ -80,17 +79,6 @@ #' # note that we only generated data for one age group #' res #' -#' # usually however your data is stored in a data.frame -#' # and you pass the specific columns directly to the function -#' data <- read.csv("", stringsAsFactors = FALSE) -#' anthro_prevalence( -#' sex = data$sex, -#' age = data$age, -#' weight = data$weight, -#' lenhei = data$height -#' ) -#' } -#' #' @return Returns a data.frame with prevalence estimates for the various #' groups. #' diff --git a/cran-comments.md b/cran-comments.md index f8b7265..d71adaa 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -10,8 +10,7 @@ * This is a resubmission: -* Description now starts with "Provides" -* Added a larger example to `anthro_prevalence` +* `anthro_prevalence` examples are not wrapped in `\dontrun` anymore ## Reverse dependencies diff --git a/docs/reference/anthro_prevalence.html b/docs/reference/anthro_prevalence.html index fa64d85..9f52bab 100644 --- a/docs/reference/anthro_prevalence.html +++ b/docs/reference/anthro_prevalence.html @@ -370,8 +370,7 @@

Details

Examples

-
# NOT RUN {
-library(anthro)
+    
library(anthro) # compute the prevalence estimates for 100 random children # with weight around 15kg and height around 100cm @@ -392,18 +391,28 @@

Examp colnames(res) <- c("Group", "Unweighted N", "-3SD", "-2SD", "z-score mean ") # note that we only generated data for one age group -res - -# usually however your data is stored in a data.frame -# and you pass the specific columns directly to the function -data <- read.csv("<your data.csv>", stringsAsFactors = FALSE) -anthro_prevalence( - sex = data$sex, - age = data$age, - weight = data$weight, - lenhei = data$height -) -# }
+res
#> Group Unweighted N -3SD -2SD z-score mean +#> 1 All 91 4.395604 6.593407 1.632857 +#> 2 Age group: 00-05 mo NA NA NA NA +#> 3 Age group: 06-11 mo NA NA NA NA +#> 4 Age group: 12-23 mo NA NA NA NA +#> 5 Age group: 24-35 mo 91 4.395604 6.593407 1.632857 +#> 6 Age group: 36-47 mo NA NA NA NA +#> 7 Age group: 48-59 mo NA NA NA NA +#> 8 Sex: Female 44 0.000000 2.272727 2.005000 +#> 9 Sex: Male 47 8.510638 10.638298 1.284468 +#> 10 Age + sex: 00-05 mo.Female NA NA NA NA +#> 11 Age + sex: 06-11 mo.Female NA NA NA NA +#> 12 Age + sex: 12-23 mo.Female NA NA NA NA +#> 13 Age + sex: 24-35 mo.Female 44 0.000000 2.272727 2.005000 +#> 14 Age + sex: 36-47 mo.Female NA NA NA NA +#> 15 Age + sex: 48-59 mo.Female NA NA NA NA +#> 16 Age + sex: 00-05 mo.Male NA NA NA NA +#> 17 Age + sex: 06-11 mo.Male NA NA NA NA +#> 18 Age + sex: 12-23 mo.Male NA NA NA NA +#> 19 Age + sex: 24-35 mo.Male 47 8.510638 10.638298 1.284468 +#> 20 Age + sex: 36-47 mo.Male NA NA NA NA +#> 21 Age + sex: 48-59 mo.Male NA NA NA NA