Description Usage Arguments Details Author(s) See Also Examples
View source: R/append.dictionary.R
A function designed to create post-hoc dictionaries in the
SemNetDictionaries
package. This allows for new semantic categories or word lists
to be saved for future use (i.e., your own personal dictionary).
Dictionaries created using this function can either be saved as an R object to your global
environment or as a .rds file on your current computer. Open-source community-derived
dictionaries can be uploaded to and downloaded from
https://github.com/AlexChristensen/SemNetDictionaries
1 2 3 4 5 6 7 8 |
... |
Character vector. A vector of words to create or add to a dictionary |
dictionary.name |
Character.
Name of dictionary to create or add words to.
Defaults to |
save.location |
Character.
A choice for where to store appendix dictionary.
Defaults to
|
path |
Character.
A path to an existing directory.
Only necessary for |
textcleaner |
Boolean.
Argument for skipping asking to save the dictionary twice.
Defaults to |
package |
Boolean. Argument not meant for user use. Allows me to update the package's dictionaries efficiently |
Appendix dictionaries are useful for storing spelling
definitions that are not available in the SemNetDictionaries
package. This function enables the storage of personalized dictionaries,
which can be used in combination with other dictionaries to facilitate
the cleaning of text data.
Dictionaries are either stored in R
's global environment,
where they will be deleted once R
is closed (unless you save them),
or in a directory you choose. A menu will pop-up asking whether you would like to
save or update your dictionary.
You have two options:
Yes
(or 1
):
Gives this function permission to
save (or update) your dictionary to a chosen directory.
If save.location = "envir"
, your file will
be deleted after closing R
No
(or 2
):
Does NOT give this function permission to save
your dictionary to your computer. save.location = "envir"
will
always return your dictionary as a vector object to R
's
global environment
To save your dictionary file, you can either:
Manually save:
Use saveRDS and save using the "*.dictionary"
suffix
save.location = "choose"
:
A file explorer menu will pop-up and a directory can be manually selected
save.location = "path"
:
The file will automatically be saved to the directory you provide
Note that save.location = "choose"
and save.location = "path"
will
automatically update your dictionary if there is a file with the same name enter
into the dictionary.name
argument.
To find where your dictionaries are stored, use the
find.dictionaries
function.
These dictionaries are only stored on
your private computer and must either be publicly shared or
transferred to other computers in order to use them elsewhere.
If you would like to share a dictionary for others to use, then please submit
a pull request or post an issue with your dictionary on my GitHub:
AlexChristensen/SemNetDictionaries.
Alexander Christensen <alexpaulchristensen@gmail.com>
find.dictionaries
to find where dictionaries are stored,
dictionaries
to identify dictionaries in
SemNetDictionaries
1 2 | # Create a dictionary
new.dictionary <- append.dictionary(c("words","are","fun"), save.location = "envir")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.