Description Usage Arguments Details Value Examples
twoCol(DF,dropcol)
1 | twoCol(DF, dropcol)
|
DF |
a data frame which includes a column of frequencies and at least one column with a binary variable used to split the frequencies. |
dropcol |
the number of the column which is a binary variable and is used to split the frequencies, and so is dropped from the new data frame. |
Removes bottom half of data frame, and appends frequencies as an extra column.
a new data frame with half the number of rows as the original, but two columns for the frequencies.
1 2 3 4 | # using the built-in Titanic dataset.
# First convert it to a data frame
TDF = as.data.frame(Titanic)
twoCol(TDF,4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.