An R package to process text with the Receptiviti API.
A Python package is also available at Receptiviti/receptiviti-python.
Download R from r-project.org, then install the package from an R console:
Release (version 0.1.8)
Development (version 0.1.9)
And load the package:
# score a single text
single <- receptiviti("a text to score")
# score multiple texts, and write results to a file
multi <- receptiviti(c("first text to score", "second text"), "filename.csv")
# score texts in separate files
## defaults to look for .txt files
file_results <- receptiviti(dir = "./path/to/txt_folder")
## could be .csv
file_results <- receptiviti(
dir = "./path/to/csv_folder",
text_column = "text", file_type = "csv"
)
# score texts in a single file
results <- receptiviti("./path/to/file.csv", text_column = "text")
To access the API, you will need to load your key and secret, as found on your dashboard.
You can enter these as arguments in each function call, but by default they will be looked for in these environment variables:
You can store these in your R environment file permanently:
Or set them temporarily: