Rtdf | R Documentation |
table
object as data.frame
.
This is a simple convenience wrapper function to print and/or store objects returned in table class
as either a matrix
, dataframe
or list
, which allows for more versatility in the printing methods for tabulations (e.g., presenting tabulations "long-ways", as opposed to the default short, and therefore potentially wide, method for the table class
). Currently only implemented for one object interpretable as a factor, since stats::ftable()
exists for multi-object tabulation
R.tdf(x, names = c(deparse(substitute(x)), "Freq"), cls = "df")
x |
an object suitable for tabulating discrete counts (i.e., interpretable as a factor). See documentation for |
names |
Character vector containing the labels to be used for |
cls |
Character string ( |
See ?base::table
.
Returns an object in the class indicated for cls
containing the frequency tabulation of discrete values in x
.
Rachel M. Smith
base::table
, stats::ftable
for multi-object tabulation.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.