splitDTRow: Split a rows of a data.table into several ones, using a...

Description Usage Arguments Examples

View source: R/splitDFRow.R

Description

From a character field with comma-separated codes, split the row in several rows, one for each code in the character field

Usage

1
splitDTRow(dt, splitby = ",", column)

Arguments

dt

the data.table to be splitted

splitby

a character sequence which will act as the separator for the character field/column

column

the column where the character codes are

Examples

1
2
dta <- data.table(a = 1:2, b = c("a, b, c", "d, e"), stringsAsFactors = FALSE)
dta2 <- splitDTRow(dta, ", ", "b")

zauster/ormisc documentation built on May 4, 2019, 9:12 p.m.