Description Usage Arguments Details Value Examples
View source: R/create_package.R
Exports one or more word dictionaries as a standalone R package
1 | create_dict_pkg(d, path, open = FALSE, rstudio = TRUE)
|
d |
Word dictionary created by |
path |
A path. If it exists, it is used. If it does not exist, it is created, provided that the parent path exists. |
open |
If TRUE, activates the new project |
rstudio |
If TRUE, calls use_rstudio() to make the new package or project into an RStudio Project. If FALSE and a non-package project, a sentinel .here file is placed so that the directory can be recognized as a project by the here or rprojroot packages. |
The created package is modelled off the extremely fast meanr package, which means it requires compilation but is extremely fast.
Path to the newly created project or package, invisibly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## create dict
d <- dict(list(
pos = c("good", "great", "awesome"),
neg = c("worst", "awful", "terrible")))
## create package path via temp directory
path_pkg <- file.path(tempdir(), "simpleexample")
## create R package featuring d
#create_dict_pkg(d, path_pkg)
## create txt vector to test package on
txt <- c("good great terrible terrible",
"good", "good", "other", "awful",
"awful", "good", "great", "terrible")
## use new package on txt
#simpleexample::score(txt)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.