Description Usage Arguments Details Examples
Add a corpus dataset to textcorpus. This function carefully checks the format of the data to make sure it meets textcorpus standards. After the function is run the contributor will need to:
1 | add_textcorpus_data(x, description, scraping.script = NULL, ...)
|
x |
A prepared textcorpus dataset. Use
|
description |
A description list that contains the required meta data
about the corpus being added. Use |
scraping.script |
An optional path to the .R script used to generate the dataset. |
... |
ignored. |
Fill in the documentation in R/data_YOUR_CONTRIBUTED_DATASET.R
Run 'devtools::document()'
Run 'devtools::check()'
Push to GitHub
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Not run:
library(dplyr)
library(stringi)
corp <- data_frame(
id = stri_rand_strings(10, 10),
author = c('sam', 'cal', 'sue', 'bob', 'sal', 'pam', 'pat', 'joe', 'arr', 'nmr'),
text = stri_rand_lipsum(10),
state = state.name[1:10],
month = month.name[1:10]
)
mydat <- prepare_textcorpus_data(corp, corpus.cols = c('id', 'author', 'text', 'state'))
desc_dat <- list(
data = "mydat",
genre = 'poem',
subgenre = 'haiku',
source = "https://url/to/nowhere.com",
submitted_by = "Tyler Rinker",
submitted_on = Sys.Date()
)
# add_textcorpus_data(mydat, desc_dat)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.