splitstr2vec: Turn ?strsplit lists into vectors

Description Usage Arguments Examples

Description

A wrapper for ?strsplit that will split the your character vector and only return the first element of the resultant list. Useful for breaking up a character vector when you only want output type, instead of having the vector embedded in a list.

Usage

1
splitstr2vec(x, split = " ")

Arguments

x

a character vector to split

split

input to ?strsplit

Examples

1
2
3
test <- 'Hello there world! I like cats and unicorns.'
strsplit2vec(test)
strsplit2vec(test)[2] 

kirstengott/kiRsten documentation built on May 20, 2019, 10:24 a.m.