| as.afactor {RelativeRisk} | R Documentation |
Changes columns of a data frame into factors
as.afactor(cName,data,levOrder,curLevs)
cName |
The quoted column name to change |
data |
A data frame, or matrix. |
levOrder |
The desired ordering of the levels. |
curLevs |
The current levels in the same order as in levOrder |
Makes the column with name cName into a factor.
if levOrder is present, these will be the levels of the factor. When curLevs is missing,the values in levOrder must be
the complete set of unique values in the cName columnn.
If curLevs is present, the levOrder values will be mapped into them in the cName column; that is,
if curLevs=1:3, and levOrder=c("a","c","b") then any value 2 in the cName column will be replaced
by "c".
A data frame with changes in the column cName.
Bob Wheeler bwheelerg@gmail.com
Please cite this program as follows:
Wheeler, R.E. (2009). as.afactor RelativeRisk. The R project for statistical computing http://www.r-project.org/