strata <- as.factor(datasets::mtcars$cyl)
# Create a "count" row from a data.frame for a factor
build_row(x = datasets::mtcars, y = strata)
# Create a row summarizing a numeric by a factor
build_row(label = 'MPG', x = as.numeric(datasets::mtcars$mpg), y = strata)
# Create a row summarizing a logical by a factor
build_row(label = 'VS', x = as.logical(datasets::mtcars$vs), y = strata)
# Create a row summarizing a factor by a factor
build_row(label = 'Carb', x = as.factor(datasets::mtcars$carb), y = strata)
Run the code above in your browser using DataLab