Split a space-delimited string into a character vector of words, this saves a bit of typing and quote-matching similar to 'list of strings'.split() in python.

s(string)
separate(string)

Arguments

string

a spaced character string to be split into a word vector

Examples

df <- data.frame(a = s("chr1 chr2 chrMT"), b = 1:3, c = 5:7) colnames(df) <- s("chr start end") df
#> chr start end #> 1 chr1 1 5 #> 2 chr2 2 6 #> 3 chrMT 3 7
# separate is an alias for s separate("split this string")
#> [1] "split" "this" "string"