Description Usage Arguments Value Examples
Convert factor columns in a data.frame into character strings
1 |
df |
A data.frame |
A data.frame with factor columns coereced into character strings
1 2 3 4 5 6 | exampleDf <- data.frame(Teams=c("HSV", "FCB", "FCB", "HSV"),
Player=c("Mueller", "Mueller", "Robben", "Holtby"),
scores=c(3.5, 1.5, 1.5, 1.0), stringsAsFactors=TRUE)
strDf <- dfFactor2Str(exampleDf)
stopifnot(identical(strDf[,1], c("HSV", "FCB", "FCB", "HSV")))
stopifnot(identical(exampleDf[,1], factor(c("HSV", "FCB", "FCB", "HSV"))))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.