addvar2 | R Documentation |
This function allows you to add derived variable (ex: add mean value by ID).
addvar2(
dat,
sort = c("SEX"),
var = "Cmax",
fun = "mean(x)=Mean",
rounding = "sigfig(x,3)"
)
dat |
data frame |
sort |
sort derived variable by ex:"ID","SEX" |
var |
variable to be derived |
fun |
deriving function ex:c"mean x =mean","length x is.na x") |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.