char_at: Character at Position _i_

Description Usage Arguments Value Author(s) Examples

View source: R/strs.R

Description

Returns the character at location i inside the string.

Usage

1
char_at(x, index)

Arguments

x

A character vector to extract position from.

index

An integer between 1 and length n.

Value

A character vector of length index.

Author(s)

James J Balamuta

Examples

1
2
3
4
5
6
7
8
# Example string
s = "statistics"

# Single character
char_at(s, 1)

# Vectorized position
char_at(s, c(2, 3))

jjb documentation built on Jan. 8, 2020, 5:07 p.m.