expand_on: Split column values by a delimiter, then expand them into new...

View source: R/expand_on.R

expand_onR Documentation

Split column values by a delimiter, then expand them into new rows

Description

Split column values by a delimiter, then expand them into new rows

Usage

expand_on(indf, .var, delim = ";")

Arguments

indf

input data.frame

.var

the column in 'indf' to split. should be character-type

delim

the string delimiter to split on

Value

A data frame where data frae, 'indf', where the strings in column, '.var', have been split by delimiter, 'delim'

See Also

tidyr::separate_rows

Examples

library(dplyr)
library(magrittr)
library(tidyr)
iris %>%
mutate_at(vars(Species), as.character) %>%
expand_on(Species, "o") %>%
select(Species) %>%
table

stackcon/rngt documentation built on June 17, 2022, 5:29 p.m.