create a data.frame summary for continuous variables

continuous_summary(
  dat,
  columns = NULL,
  by = character(0),
  hide_grouplabel = TRUE,
  digits = 3
)

Arguments

dat

a data.frame

columns

continuous variables to be summarized. If NULL all continuous variables are summarized.

by

discrete variables to use as groups when summarizing.

hide_grouplabel

if TRUE, group label will not be rendered, only level/value will be rendered.

digits

the desired number of digits after the decimal point

Illustrations

Examples

ft_1 <- continuous_summary(iris, names(iris)[1:4], by = "Species",
  hide_grouplabel = FALSE)
ft_1
#> a flextable object.
#> col_keys: `Species`, `N`, `MIN`, `Q1`, `MEDIAN`, `Q3`, `MAX`, `MEAN`, `SD`, `MAD`, `NAS` 
#> header has 1 row(s) 
#> body has 16 row(s) 
#> original dataset sample: 
#>       variable    Species  N MIN    Q1 MEDIAN  Q3 MAX  MEAN        SD     MAD
#> 1 Sepal.Length       <NA> NA  NA    NA     NA  NA  NA    NA        NA      NA
#> 5         <NA>     setosa 50 4.3 4.800    5.0 5.2 5.8 5.006 0.3524897 0.29652
#> 6         <NA> versicolor 50 4.9 5.600    5.9 6.3 7.0 5.936 0.5161711 0.51891
#> 7         <NA>  virginica 50 4.9 6.225    6.5 6.9 7.9 6.588 0.6358796 0.59304
#> 2  Sepal.Width       <NA> NA  NA    NA     NA  NA  NA    NA        NA      NA
#>   NAS
#> 1  NA
#> 5   0
#> 6   0
#> 7   0
#> 2  NA