takeElementInSplit: Take an element in a split.

Description Usage Arguments Examples

Description

Split the vector and take the i-th element in each part of the vector.

Usage

1
takeElementInSplit(x,split,numeroElement)

Arguments

x

character vector, each element of which is to be split. Other inputs, including a factor, will give an error.

split

character vector (or object which can be coerced to such) containing regular expression(s) (unless fixed = TRUE) to use for splitting. If empty matches occur, in particular if split has length 0, x is split into single characters. If split has length greater than 1, it is re-cycled along x.

numeroElement

indice specifying elements to extract.

Examples

1
2
3
# x <- c("a_b","b_c","c_d")

# takeElementInSplit(x,split="_",numeroElement=1)

Blitzy29/R.PersonalTools documentation built on May 6, 2019, 7:57 a.m.