Create a table with a data.frame structure and optional proportion,
percentage, and descriptive statistics columns. Can be used by its shorthand
alias dft.
Usage
data_frame_table(data1, prop = TRUE, perc = TRUE, by = NULL)
dft(data1, prop = TRUE, perc = TRUE, by = NULL)
Arguments
data1
a vector or data.frame column
prop
logical, if TRUE returns an additional proportion column
perc
logical, if TRUE returns an additional percentage column
by
numeric variable to return descriptive statistics for
Value
a data.frame table with optional proportion, percentage, and
descriptive statistics columns
data_frame_table(iris2$Species)
data_frame_table(iris2$Species, by = iris2$Sepal.Length)
# Or using shorthand:
dft(iris2$Species)
dft(iris2$Species, by = iris2$Sepal.Length)