data.frame
into a frequency table with prespecified entries. Uses a modified version of the count function which also accepts weights.
Zero-entries can be included or excluded and the variables can be coerced into factors if necessary.subtable(data, cols, freqvar = NULL,
keep.zero = FALSE, allfactor = FALSE, return.type = class(data))
data.frame
to reduce.V
.
If dset
contains a variable called "Freq"
(see ftable)
it will be defined as frequency variable if freqvar
isdata.frame
or table
. The default is to use the same type as the input had.data.frame
including a "Freq"
variable.keep.zero
and allfactor
and to be able to handle both raw datasets and datasets with a frequency variable.hs2 = subtable(housing,c(3,1))
summary(hs2)
Run the code above in your browser using DataLab