| paste.data.frame | R Documentation |
This function is similar to paste
but works on a data.frame, hence paste.data.frame.
It concatenates text belonging to groups of data together in one string.
The function is the inverse operation of strsplit.data.frame.
paste.data.frame(data, term, group, collapse = " ")
data |
a data.frame or data.table |
term |
a string with a column name or a character vector of column names from |
group |
a string with a column name or a character vector of column names from |
collapse |
a character string that you want to use to collapse the text data together. Defaults to a single space. |
A data.frame with 1 row per group containing the columns from group and term
where all the text in term for each group will be paste-d together, separated by the collapse argument.
strsplit.data.frame, paste
data(brussels_reviews_anno, package = "udpipe")
head(brussels_reviews_anno)
x <- paste.data.frame(brussels_reviews_anno,
term = "lemma",
group = c("doc_id", "sentence_id"))
str(x)
x <- paste.data.frame(brussels_reviews_anno,
term = c("lemma", "token"),
group = c("doc_id", "sentence_id"),
collapse = "-")
str(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.