splitcol: take a data.table, split col into multiple columns based...

Description Usage Arguments Value Examples

View source: R/sxpdatafunc.R

Description

in place change to dt

Usage

1
2
splitcol(dt, col, sep1 = "_", sep2 = ":", mode = 1,
  splitcolnames = NULL)

Arguments

dt

a data.table

col

column to split, quote

sep1

level 1 sep1

sep2

level 1 sep2

mode

default 1

splitcolnames

used in mode 0, names of splitted columns

Value

no return, inplace change to dt

Examples

1
2
mode 1: split "X:1_Y:2" into two columns X,Y, fill with 1,2;
mode 0: split "1_2" into 1 and 2, column names defined by splitcolnames if given, otherwise use V1,V2...

quicksea/workutil documentation built on May 26, 2019, 1:31 p.m.