lnt_add | R Documentation |
This functions adds a dataframe to a slot in an LNToutput object or overwrites existing entries. The main use of the function is to add an extract of one of the data.frames back to an LNToutput object after operations were performed on it.
lnt_add(to, what, where = "meta", replace = TRUE)
to |
an LNToutput object to which something should be added. |
what |
A data.frame which is added. |
where |
Either "meta", "articles" or "paragraphs" to indicate the slot to which data is added. |
replace |
If TRUE, will overwrite entries which have the same ID as |
Note, that when adding paragraphs, the Par_ID column is used to determine if entries are already present in the set. For the other data frames the article ID is used.
Johannes Gruber
# Make LNToutput object from sample
LNToutput <- lnt_read(lnt_sample(copy = FALSE))
# extract meta and make corrections
correction <- LNToutput@meta[grepl("Wikipedia", LNToutput@meta$Headline), ]
correction$Newspaper <- "Wikipedia"
# replace corrected meta information
LNToutput <- lnt_add(to = LNToutput, what = correction, where = "meta", replace = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.