write_csv | R Documentation |
This function can be used to save the document-term matrix of a MetaNLP object as a csv-file.
write_csv(object, ...)
## S4 method for signature 'MetaNLP'
write_csv(object, path, type = c("train", "test"), ...)
object |
An object of class MetaNLP. |
... |
Additional arguments for write.table, e.g. encoding
as |
path |
Path where to save the csv. |
type |
Specifies if the document-term matrix should be saved as
"train_wcm.csv" or "test_wcm.csv". If the user wants to use another file name,
the whole path including the file name should be given as the |
If a path to a specific folder is given (but the path name does not end with ".csv"), the file is saved in this folder as "train_wcm.csv" or "test_wcm.csv". By providing a path ending with ".csv", the user can override the default naming convention and the file is saved according to this path.
nothing
path <- system.file("extdata", "test_data.csv", package = "MetaNLP", mustWork = TRUE)
obj <- MetaNLP(path)
obj2 <- delete_stop_words(obj)
write_path <- tempdir()
write_csv(obj2, path = write_path)
file.remove(file.path(write_path, "train_wcm.csv"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.