tablet.tablette | R Documentation |
Converts to 'tablette' from 'tablet'.
I.e., makes compact data.frame that emulates
the layout expected by as_kable
.
Preserves attributes 'n', 'label', 'codelist', and 'latex' class if present.
## S3 method for class 'tablette'
tablet(x, ...)
x |
object of dispatch |
... |
passed arguments |
tablette : a data.frame with columns for each combination of groups, and:
_tablet_name |
observation identifier: character, possibly 'latex'; has a codelist attribute the values of which are the original column names |
_tablet_level |
factor level, or the LHS of formulas in 'num' |
All (or value of 'all' argument) |
ungrouped results |
Other tablet:
as_tablet()
,
as_tablet.data.frame()
,
header_rows()
,
header_rows.tablet()
,
tablette.tablet()
library(boot)
library(dplyr)
library(magrittr)
library(yamlet)
rm(melanoma)
melanoma %<>% select(-time, -year)
melanoma %<>% decorate('
time: [ Survival Time Since Operation, day ]
status: [ End of Study Patient Status,
[ Alive: 2, Melanoma Death: 1, Unrelated Death: 3 ]]
sex: [ Sex, [ Male: 1, Female: 0 ]]
age: [ Age at Time of Operation, year ]
thickness: [ Tumor Thickness, mm ]
ulcer: [ Ulceration, [ Absent: 0, Present: 1 ]]
')
melanoma %<>% resolve
melanoma %<>% group_by(status, ulcer)
melanoma %<>% tablet
melanoma %>% header_rows
melanoma %>% as_kable
melanoma %>% tablette
melanoma %>% tablette %>% tablet
identical(melanoma, tablet(tablette(melanoma)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.