Learn R Programming

udpipe (version 0.8.3)

txt_next: Get the n-th next element of a vector

Description

Get the n-th next element of a vector

Usage

txt_next(x, n = 1)

Arguments

x

a character vector where each element is just 1 term or word

n

an integer indicating how far to look next. Defaults to 1.

Value

a character vector of the same length of x with the next element

See Also

shift

Examples

Run this code
# NOT RUN {
x <- sprintf("%s%s", LETTERS, 1:26)
txt_next(x, n = 1)

data.frame(word = x,
           word_next1 = txt_next(x, n = 1),
           word_next2 = txt_next(x, n = 2),
           stringsAsFactors = FALSE)
# }

Run the code above in your browser using DataLab