diff --git a/docs/ISSUE_TEMPLATE.html b/docs/ISSUE_TEMPLATE.html index 0e65d1c1c..2a3fda9e0 100644 --- a/docs/ISSUE_TEMPLATE.html +++ b/docs/ISSUE_TEMPLATE.html @@ -60,7 +60,7 @@
@@ -119,7 +119,7 @@Please briefly describe your problem and, when relevant, the output you expect. Please also provide the output of utils::sessionInfo()
or devtools::session_info()
at the end of your post.
Please briefly describe your problem and, when relevant, the output you expect. Please also provide the output of utils::sessionInfo()
or devtools::session_info()
at the end of your post.
If at all possible, please include a minimal, reproducible example. The rtables
team will be much more likely to resolve your issue if they are able to reproduce it themselves locally.
Please delete this preamble after you have read it.
vignettes/rtables.Rmd
rtables.Rmd
To install the stable release of rtables
package run the following command in R
:
devtools::install_github("roche/rtables", ref="v0.1.1")
devtools::install_github("roche/rtables", ref="v0.1.1")
To install the test version of rtables
run
devtools::install_github("roche/rtables")
devtools::install_github("roche/rtables")
library(rtables)
+
tbl <- rtable(
header = c("Treatement\nN=100", "Comparison\nN=300"),
format = "xx (xx.xx%)",
diff --git a/docs/news/index.html b/docs/news/index.html
index 881a46be6..b133bb17c 100644
--- a/docs/news/index.html
+++ b/docs/news/index.html
@@ -60,7 +60,7 @@
NEWS.md
rbind.rtable
now supports binding rtables with rows, e.g. rbind(tbl1, rrow(), tbl2)
or rbind(tbl1, rrow("row name"), tbl2)
.rbindl_rtables
supports NULL
objects in the list (except for the first element)indent
functionheader_add_N
deals gracefully with NULL
objectsChange indentation of all rrows in an rtable
+ +indent(x, by = 1)+ +
x | +
|
+
---|---|
by | +integer to increase indentation of rows. Can be negative. If final indentation is smaller than 0 then the +indentation is set to 0. |
+
+is_setosa <- iris$Species == "setosa" +mtbl <- rtable( + header = rheader( + rrow(row.name = NULL, rcell("Sepal.Length", colspan = 2), rcell("Petal.Length", colspan=2)), + rrow(NULL, "mean", "median", "mean", "median") + ), + rrow( + row.name = "All Species", + mean(iris$Sepal.Length), median(iris$Sepal.Length), + mean(iris$Petal.Length), median(iris$Petal.Length), + format = "xx.xx" + ), + rrow( + row.name = "Setosa", + mean(iris$Sepal.Length[is_setosa]), median(iris$Sepal.Length[is_setosa]), + mean(iris$Petal.Length[is_setosa]), median(iris$Petal.Length[is_setosa]), + format = "xx.xx" + ) +) +indent(mtbl)#> Sepal.Length Petal.Length +#> mean median mean median +#> --------------------------------------------------------------------- +#> All Species 5.84 5.8 3.76 4.35 +#> Setosa 5.01 5 1.46 1.5indent(mtbl, 2)#> Sepal.Length Petal.Length +#> mean median mean median +#> ----------------------------------------------------------------------- +#> All Species 5.84 5.8 3.76 4.35 +#> Setosa 5.01 5 1.46 1.5indent(mtbl, -3)#> Sepal.Length Petal.Length +#> mean median mean median +#> ------------------------------------------------------------------- +#> All Species 5.84 5.8 3.76 4.35 +#> Setosa 5.01 5 1.46 1.5+
Stack rtable objects
Stack rtable and rrow objects
Change indentation of all rrows in an rtable
Unlist method for rtables
Unlist method for rcell
Unlist method for rrow
rtable
objects
rtable
or length 0 rcell
objects, the first object must be an
+rtable
object
rtable, rrow, and rcell objects should not be unlisted. This allows us to create nested lists with rtables objects +and then flatten them to a list of rtable objects.
+ +# S3 method for rcell +unlist(x, recursive = TRUE, use.names = TRUE)+ +
x | +an R object, typically a list or vector. |
+
---|---|
recursive | +logical. Should unlisting be applied to list
+ components of |
+
use.names | +logical. Should names be preserved? |
+
rrow object
+ + +rtable, rrow, and rcell objects should not be unlisted. This allows us to create nested lists with rtables objects +and then flatten them to a list of rtable objects.
+ +# S3 method for rrow +unlist(x, recursive = TRUE, use.names = TRUE)+ +
x | +an R object, typically a list or vector. |
+
---|---|
recursive | +logical. Should unlisting be applied to list
+ components of |
+
use.names | +logical. Should names be preserved? |
+
rrow object
+ + +rtable objects should not be unlisted. This allows us to create nested lists with rtables objects and then flatten -them to a list of rtable objects.
+rtable, rrow, and rcell objects should not be unlisted. This allows us to create nested lists with rtables objects +and then flatten them to a list of rtable objects.