Learn R Programming

udpipe (version 0.8.11)

unlist_tokens: Create a data.frame from a list of tokens

Description

Create a data.frame from a list of tokens.

Usage

unlist_tokens(x)

Value

the data of x converted to a data.frame. This data.frame has columns doc_id and token where the doc_id is taken from the list names of x and token contains the data of x

Arguments

x

a list where the list elements are character vectors of tokens

Examples

Run this code
x <- setNames(c("some text here", "hi  there understand this?"), c("a", "b"))
x <- strsplit(x, split = " ")
x
unlist_tokens(x)

Run the code above in your browser using DataLab