twoCol: Prepares data frame for analysis by binomial glm using...

Description Usage Arguments Details Value Examples

Description

twoCol(DF,dropcol)

Usage

1
twoCol(DF, dropcol)

Arguments

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.

Details

Removes bottom half of data frame, and appends frequencies as an extra column.

Value

a new data frame with half the number of rows as the original, but two columns for the frequencies.

Examples

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)

helophilus/ColsTools documentation built on May 30, 2019, 4:03 p.m.