Skip to contents

[Stable]

This is a new generic function to convert objects to rtable tables.

Usage

as.rtable(x, ...)

# S3 method for data.frame
as.rtable(x, format = "xx.xx", ...)

Arguments

x

the object which should be converted to an rtable.

...

additional arguments for methods.

format

the format which should be used for the columns.

Value

An rtables table object. Note that the concrete class will depend on the method used.

Methods (by class)

  • as.rtable(data.frame): method for converting data.frame that contain numeric columns to rtable.

Examples

x <- data.frame(
  a = 1:10,
  b = rnorm(10)
)
as.rtable(x)
#>        a       b  
#> ——————————————————
#> 1    1.00    0.32 
#> 2    2.00    0.79 
#> 3    3.00    1.59 
#> 4    4.00    0.15 
#> 5    5.00    -0.06
#> 6    6.00    0.02 
#> 7    7.00    -0.40
#> 8    8.00    0.42 
#> 9    9.00    0.09 
#> 10   10.00   1.74