# NOT RUN {
# convert a data frame:
emoji <- data.frame(text = sapply(0x1f600 + 1:30, intToUtf8),
stringsAsFactors = FALSE)
as_corpus(emoji)
# construct directly (no need for stringsAsFactors = FALSE):
corpus(text = sapply(0x1f600 + 1:30, intToUtf8))
# convert a character vector:
as_corpus(c(a = "goodnight", b = "moon")) # keeps names
as_corpus(c(a = "goodnight", b = "moon"), row.names = NULL) # drops names
# }
Run the code above in your browser using DataLab