splitDFstrings {reposTools}R Documentation

A function to split vector strings in a data.frame

Description

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")).

Usage

splitDFstrings(df, fields, delim = ",[[:space:]]*")

Arguments

df A data.frame
fields Set of columns (fields) to split
delim Delimiter to split on. Default is ", "

Value

The data.frame with the specified columns appropriately manipulated.

Author(s)

Jeff Gentry

Examples

   a <- data.frame(I("foo, blah"))
   colnames(a) <- "bar"
   a
   splitDFstrings(a,"bar")
   a$bar

[Package reposTools version 1.8.0 Index]