splitDFstrings {reposTools} | R Documentation |
Given a data.frame and a set of fields, will take any "string of strings" (e.g. "foo, blah, bar") and split them into a vector of strings (e.g. c("foo", "blah", "bar")).
splitDFstrings(df, fields, delim = ",[[:space:]]*")
df |
A data.frame |
fields |
Set of columns (fields) to split |
delim |
Delimiter to split on. Default is ", " |
The data.frame with the specified columns appropriately manipulated.
Jeff Gentry
a <- data.frame(I("foo, blah")) colnames(a) <- "bar" a splitDFstrings(a,"bar") a$bar