From b4f617941cfa2c1d3c0624bc0ff508a8ea85f0da Mon Sep 17 00:00:00 2001 From: waddella Date: Tue, 14 Aug 2018 10:12:46 -0400 Subject: [PATCH 1/3] replace tapply with table to count number of elements per factor level as tapply returns NA if there is no data for a level --- R/rtable.R | 4 ++-- R/rtabulate.R | 2 +- docs/dev/articles/rtables.html | 2 +- docs/dev/pkgdown.yml | 4 ++-- docs/dev/reference/rrowl.html | 2 +- man/rrowl.Rd | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/R/rtable.R b/R/rtable.R index 64de2b8bb..30c70c122 100644 --- a/R/rtable.R +++ b/R/rtable.R @@ -281,8 +281,8 @@ rheader <- function(..., format = "xx") { #' rrowl("a", c(1,2,3), c(4,5,6), format = "xx") #' #' -#' rrowl("N", tapply(iris$Species, iris$Species, length)) -#' rrowl("N", tapply(iris$Species, iris$Species, length), format = "xx") +#' rrowl("N", table(iris$Species)) +#' rrowl("N", table(iris$Species), format = "xx") #' #' x <- tapply(iris$Sepal.Length, iris$Species, mean, simplify = FALSE) #' diff --git a/R/rtabulate.R b/R/rtabulate.R index 2350e52ad..4e4b2c6c9 100644 --- a/R/rtabulate.R +++ b/R/rtabulate.R @@ -58,7 +58,7 @@ rtabulate_header <- function(col_by, Ntot, N=NULL, format="(N=xx)") { rheader(lvls) } else { if (is.null(N)) { - N <- if (is.no_by(col_by)) Ntot else tapply(col_by, col_by, length) + N <- if (is.no_by(col_by)) Ntot else table(col_by) } rheader( rrowl("", lvls), diff --git a/docs/dev/articles/rtables.html b/docs/dev/articles/rtables.html index ab1542043..06ac2db97 100644 --- a/docs/dev/articles/rtables.html +++ b/docs/dev/articles/rtables.html @@ -86,7 +86,7 @@

Introduction to rtables

Adrian Waddell

-

2018-06-09

+

2018-08-14

Source: vignettes/rtables.Rmd diff --git a/docs/dev/pkgdown.yml b/docs/dev/pkgdown.yml index 5b1127157..0480469ec 100644 --- a/docs/dev/pkgdown.yml +++ b/docs/dev/pkgdown.yml @@ -1,6 +1,6 @@ pandoc: 1.19.2.1 -pkgdown: 1.1.0.9000 -pkgdown_sha: bcf6299e76d4a398aadfc476b3ac22d253a91d35 +pkgdown: 1.1.0 +pkgdown_sha: ~ articles: rtables: rtables.html rtabulate: rtabulate.html diff --git a/docs/dev/reference/rrowl.html b/docs/dev/reference/rrowl.html index 050695024..363cda858 100644 --- a/docs/dev/reference/rrowl.html +++ b/docs/dev/reference/rrowl.html @@ -161,7 +161,7 @@

Examp
rrowl("a", c(1,2,3), format = "xx")
#> a 1 2 3
rrowl("a", c(1,2,3), c(4,5,6), format = "xx")
#> a 1 2 3 4 5 6
-rrowl("N", tapply(iris$Species, iris$Species, length))
#> N 50 50 50
rrowl("N", tapply(iris$Species, iris$Species, length), format = "xx")
#> N 50 50 50
+rrowl("N", table(iris$Species))
#> N 50 50 50
rrowl("N", table(iris$Species), format = "xx")
#> N 50 50 50
x <- tapply(iris$Sepal.Length, iris$Species, mean, simplify = FALSE) rrow(row.name = "row 1", x)
#> row 1 5.006, 5.936, 6.588
rrow("ABC", 2, 3)
#> ABC 2 3
diff --git a/man/rrowl.Rd b/man/rrowl.Rd index 6eb14ee8a..18c4bf396 100644 --- a/man/rrowl.Rd +++ b/man/rrowl.Rd @@ -30,8 +30,8 @@ rrowl("a", c(1,2,3), format = "xx") rrowl("a", c(1,2,3), c(4,5,6), format = "xx") -rrowl("N", tapply(iris$Species, iris$Species, length)) -rrowl("N", tapply(iris$Species, iris$Species, length), format = "xx") +rrowl("N", table(iris$Species)) +rrowl("N", table(iris$Species), format = "xx") x <- tapply(iris$Sepal.Length, iris$Species, mean, simplify = FALSE) From ea44f424a7597ded87b73bc261dbf0ac87d4924e Mon Sep 17 00:00:00 2001 From: waddella Date: Fri, 21 Sep 2018 02:19:17 -0700 Subject: [PATCH 2/3] version bump --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index bf975c4f1..7e4f1436f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: rtables Title: Reporting Tables -Version: 0.1.0.1 +Version: 0.1.0.5 Authors@R: c( person("Adrian", "Waddell", email = "adrian.waddell@roche.com", role = c("aut", "cre")) ) From cf7603508d9c88ddc0a4c13eb3b4b8c48b0acea1 Mon Sep 17 00:00:00 2001 From: waddella Date: Fri, 21 Sep 2018 02:25:31 -0700 Subject: [PATCH 3/3] update documentation --- NEWS.md | 5 ++--- docs/dev/ISSUE_TEMPLATE.html | 2 +- docs/dev/LICENSE-text.html | 2 +- docs/dev/articles/index.html | 2 +- docs/dev/articles/rtables.html | 4 ++-- docs/dev/articles/rtabulate.html | 2 +- docs/dev/authors.html | 2 +- docs/dev/index.html | 2 +- docs/dev/news/index.html | 8 ++++---- docs/dev/reference/Viewer.html | 2 +- docs/dev/reference/as.rtable.html | 2 +- docs/dev/reference/as.rtable.table.html | 2 +- docs/dev/reference/as_html.default.html | 2 +- docs/dev/reference/as_html.html | 2 +- docs/dev/reference/compare_rtables.html | 2 +- docs/dev/reference/dim.rheader.html | 2 +- docs/dev/reference/dim.rtable.html | 2 +- docs/dev/reference/format_rcell.html | 2 +- docs/dev/reference/header-set.html | 2 +- docs/dev/reference/header.html | 2 +- docs/dev/reference/indented_row.names.html | 2 +- docs/dev/reference/index.html | 2 +- docs/dev/reference/is.no_by.html | 2 +- docs/dev/reference/list_rcell_format_labels.html | 2 +- docs/dev/reference/names.rtable.html | 2 +- docs/dev/reference/no_by.html | 2 +- docs/dev/reference/rbind.rtable.html | 2 +- docs/dev/reference/rcell.html | 2 +- docs/dev/reference/rheader.html | 2 +- docs/dev/reference/row.names-set-.rtable.html | 2 +- docs/dev/reference/row.names.rheader.html | 2 +- docs/dev/reference/row.names.rtable.html | 2 +- docs/dev/reference/rrow.html | 2 +- docs/dev/reference/rrowl.html | 2 +- docs/dev/reference/rtable.html | 2 +- docs/dev/reference/rtablel.html | 2 +- docs/dev/reference/rtabulate.data.frame.html | 2 +- docs/dev/reference/rtabulate.factor.html | 2 +- docs/dev/reference/rtabulate.html | 2 +- docs/dev/reference/rtabulate.logical.html | 2 +- docs/dev/reference/rtabulate.numeric.html | 2 +- docs/dev/reference/sprintf_format.html | 2 +- docs/dev/reference/sub-.rheader.html | 2 +- docs/dev/reference/sub-.rtable.html | 2 +- docs/dev/reference/toString.rtable.html | 2 +- 45 files changed, 50 insertions(+), 51 deletions(-) diff --git a/NEWS.md b/NEWS.md index f34649988..7d544020a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,8 +1,7 @@ -## rtable 0.1.1 +## rtable 0.1.0.5 -* added `sprintf_format` for formatting rcells (thanks to Doug Kelkhoff for the -suggestion) +* added `sprintf_format` for formatting rcells (thanks to Doug Kelkhoff for the suggestion) * added `"(N=xx)"` and `">999.9"` format labels * `rtabulate` has now an argument `col_total` and shows by default the numbers of elements associated with a column diff --git a/docs/dev/ISSUE_TEMPLATE.html b/docs/dev/ISSUE_TEMPLATE.html index f2005a029..a12db9a08 100644 --- a/docs/dev/ISSUE_TEMPLATE.html +++ b/docs/dev/ISSUE_TEMPLATE.html @@ -58,7 +58,7 @@ rtables - 0.1.0.1 + 0.1.0.5
diff --git a/docs/dev/LICENSE-text.html b/docs/dev/LICENSE-text.html index 5a134b966..438b0e4da 100644 --- a/docs/dev/LICENSE-text.html +++ b/docs/dev/LICENSE-text.html @@ -58,7 +58,7 @@ rtables - 0.1.0.1 + 0.1.0.5 diff --git a/docs/dev/articles/index.html b/docs/dev/articles/index.html index 69682b057..f0f011711 100644 --- a/docs/dev/articles/index.html +++ b/docs/dev/articles/index.html @@ -58,7 +58,7 @@ rtables - 0.1.0.1 + 0.1.0.5 diff --git a/docs/dev/articles/rtables.html b/docs/dev/articles/rtables.html index 06ac2db97..1842acddc 100644 --- a/docs/dev/articles/rtables.html +++ b/docs/dev/articles/rtables.html @@ -30,7 +30,7 @@ rtables - 0.1.0.1 + 0.1.0.5 @@ -86,7 +86,7 @@

Introduction to rtables

Adrian Waddell

-

2018-08-14

+

2018-09-21

Source: vignettes/rtables.Rmd diff --git a/docs/dev/articles/rtabulate.html b/docs/dev/articles/rtabulate.html index a4fdfa0c4..da60de6e6 100644 --- a/docs/dev/articles/rtabulate.html +++ b/docs/dev/articles/rtabulate.html @@ -30,7 +30,7 @@ rtables - 0.1.0.1 + 0.1.0.5 diff --git a/docs/dev/authors.html b/docs/dev/authors.html index d27726b9b..b2d02f596 100644 --- a/docs/dev/authors.html +++ b/docs/dev/authors.html @@ -58,7 +58,7 @@ rtables - 0.1.0.1 + 0.1.0.5 diff --git a/docs/dev/index.html b/docs/dev/index.html index 6bac0b0b4..63294a7f0 100644 --- a/docs/dev/index.html +++ b/docs/dev/index.html @@ -32,7 +32,7 @@ rtables - 0.1.0.1 + 0.1.0.5 diff --git a/docs/dev/news/index.html b/docs/dev/news/index.html index 85a009b5a..eb40ec04f 100644 --- a/docs/dev/news/index.html +++ b/docs/dev/news/index.html @@ -58,7 +58,7 @@ rtables - 0.1.0.1 + 0.1.0.5 @@ -116,9 +116,9 @@

Changelog

Source: NEWS.md -
+

-rtable 0.1.1

+rtable 0.1.0.5