vec2columns: Split a character column into multiple values

View source: R/skUtils.R

vec2columnsR Documentation

Split a character column into multiple values

Description

Split a character column into multiple values

Usage

vec2columns(x, sep = ";")

Arguments

x

a character vector to split into columns.

sep

a character separating the different values.

Value

a data.frame of boolean values, with each row representing a value of x and each column representing a unique value in x following splitting. A column is marked TRUE in a specific row if the value representing that column was present in that row.

Author(s)

Sercan Kahveci

Examples

unsplit<-c("flour;salt;baking soda;steak;sugar;water;sauce;vinegar",
"flour;sauce;mustard;salt;pepper;vinegar;baking soda;water;tomatoes;onion;steak")
vec2columns(unsplit)


Spiritspeak/skMisc documentation built on April 12, 2025, 5:40 a.m.