Learn R Programming

do (version 2.0.0.1)

split_expand: Split One Column and Expand

Description

Split One Column and Expand

Usage

split_expand(data, variable, sep)

Value

expanded dataframe or matrix

Arguments

data

dataframe or matrix

variable

one column name with connected values

sep

seperated symbol, which can be one or more

Examples

Run this code
df=data.frame(a=c(1,0),
              b=c('a','n'),
           cyl=c('6;6;4;4;4',
                 '6;8;'))
split_expand(data=df,variable='cyl',sep=';')

Run the code above in your browser using DataLab