ss: ss

Description Usage Arguments Value Examples

Description

extract a specific slot from each element of a character vector

Usage

1
ss(x, pattern, slot = 1, ...)

Arguments

x

character vector

pattern

slot separator

slot

slot index to get (default 1)

...

extra arguments for strsplit

Value

vector, same length as x, with elements consisting of only the slotth slot of the corresponding elements in x.

Examples

1
2
3
fullnames = c('Hilary Clinton', 'Florence Nightingale', 'Rosalind Franklin')
  firstnames = ss(fullnames, ' ', slot=1)
  lastnames = ss(fullnames, ' ', slot=2)

alyssafrazee/usefulstuff documentation built on May 12, 2019, 2:33 a.m.