strscan: Extract words from a string vector.

Description Usage Arguments Value Examples

View source: R/strscan.R

Description

This function split a string into several string components divided by delimiter, and devided components selected by position are returned.

Usage

1
strscan(src, delimiter, pos)

Arguments

src

a source string vector to be split.

delimiter

a delimiter string.

pos

a subset indicator vector to select.

Value

a string vector to be extracted.

Examples

1
2
3
4
5
bdate <- c("3/21/1941", "9/21/1919", "6/1/1951")
datestr <- paste(strscan(bdate, "/", 3), strscan(bdate, "/", 1), strscan(bdate, "/", 2),
                 sep="-")
datestr
as.Date(bdate, '%m/%d/%Y')

epifit documentation built on May 29, 2017, 3:43 p.m.