add_textcorpus_data: Add a Corpus Dataset to 'textcorpus'

Description Usage Arguments Details Examples

Description

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:

Usage

1
add_textcorpus_data(x, description, scraping.script = NULL, ...)

Arguments

x

A prepared textcorpus dataset. Use prepare_textcorpus_data to ensure data is in the correct format.

description

A description list that contains the required meta data about the corpus being added. Use description_template to start the template.

scraping.script

An optional path to the .R script used to generate the dataset.

...

ignored.

Details

  1. Fill in the documentation in R/data_YOUR_CONTRIBUTED_DATASET.R

  2. Run 'devtools::document()'

  3. Run 'devtools::check()'

  4. Push to GitHub

Examples

 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)

trinker/textcorpus documentation built on June 1, 2019, 12:53 a.m.