s: Separate a string into words

Description Usage Arguments Examples

View source: R/pyfuns.R

Description

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.

Usage

1
2
s(string)
separate(string)

Arguments

string

a spaced character string to be split into a word vector

Examples

1
2
3
4
5
6
7
8
9
df <- data.frame(a = s("chr1 chr2 chrMT"),
                 b = 1:3,
                 c = 5:7)

colnames(df) <- s("chr start end")
df

# separate is an alias for s
separate("split this string")

blmoore/pythonistr documentation built on May 20, 2019, 3:34 p.m.