s: Split a vector into single characters or digits

Description Usage Arguments Value Examples

Description

Takes a string and returns all separated characters. If the input is numeric, the input is split into its digits and returned as numerics.

Usage

1
s(x, on = "")

Arguments

x

Vector to split. Can be numeric or character.

on

Character string to split on, defaults to "".

Value

If length(x) == 1, returns split as a vector, else as a list.

Examples

1
2
3
4
s("bla")
s(c("bla", "bla"))
s(155)
s(c(151, 239))

JarkoDubbeldam/RG documentation built on May 30, 2019, 8 a.m.