chn: Get the 'n'-th character element-wise.

View source: R/chn.R

chnR Documentation

Get the n-th character element-wise.

Description

Get the n-th character element-wise.

Usage

chn(x, n)

charn(x, n)

Arguments

x

A populated character object.

n

A positive whole-number scalar or a complete positive whole-number object of the same dimensions as x.

Value

A complete onechar atomic object of the same dimension as x.

See Also

Other strings: blank(), delim(), fsub(), gr, ipat(), makestr(), markdown_help(), maxnch(), ox(), ox_vals(), pgrid_help(), revstr(), spaces(), ss_help(), tocase(), weave()

Other chars: maxnch(), revstr(), spaces(), ss_help()

Examples

words <- stringr::fruit[1:10]
words
chn(words, 1)
chn(words, 3)
charn(words, 10)

j-martineau/uj documentation built on Sept. 14, 2024, 4:40 a.m.