append.dictionary {SemNetDictionaries} | R Documentation |
Appendix Dictionary
Description
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
Usage
append.dictionary(
...,
dictionary.name = "appendix",
save.location = c("envir", "wd", "choose", "path"),
path = NULL,
textcleaner = FALSE,
package = FALSE
)
Arguments
... |
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 |
Details
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
(or1
): Gives this function permission to save (or update) your dictionary to a chosen directory. Ifsave.location = "envir"
, your file will be deleted after closingR
No
(or2
): 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 toR
's global environment
To save your dictionary file, you can either:
Manually save: Use saveRDS and save using the
"*.dictionary"
suffixsave.location = "choose"
: A file explorer menu will pop-up and a directory can be manually selectedsave.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.
Author(s)
Alexander Christensen <alexpaulchristensen@gmail.com>
See Also
find.dictionaries
to find where dictionaries are stored,
dictionaries
to identify dictionaries in
SemNetDictionaries
Examples
# Create a dictionary
new.dictionary <- append.dictionary(c("words","are","fun"), save.location = "envir")