separate_var: Separate columns

View source: R/separate_var.R

separate_varR Documentation

Separate columns

Description

Separate columns

Usage

separate_var(data, var, by, names, into = c("cols", "rows"))

Arguments

data

dataset

var

name of variable to be separated

by

a string as delimiter between values (separate by delimiter) or integer(s) as number of characters to split by (separate by position), the length of by should be 1 unless by is integer and into = "cols"; if by is a non-integer numeric vector its values will be rounded down to the nearest integer

names

for into = "cols", a character vector of output column names; use NA if there are components that you don't want to appear in the output; the number of non-NA elements determines the number of new columns in the result

into

whether to split into new rows or columns

Value

Separated dataset

Author(s)

Zhaoming Su


iNZightVIT/iNZightTools documentation built on May 4, 2024, 6:20 a.m.