View source: R/toponym_options.R
| toponymOptions | R Documentation |
toponymThis function allows users to set the download path for the toponym package. Downloaded data includes toponym data and map data.
toponymOptions(toponym_path = NULL)
toponym_path |
character string. Path name for downloaded data. This setting is saved across sessions. |
Most functions require external data which will be downloaded and stored for later use. This is described in the respective functions.
For this reason, after installation, users will be asked to specify the path for downloaded data.
Parameter toponym_path accepts either the character string "pkgdir" or a full, alternative path.
"pkgdir" is interpreted as the extdata folder in the toponym package directory, i.e.:
system.file("extdata", package = "toponym")
Thus, users can set the path to the package directory with this command:
toponymOptions(toponym_path = "pkgdir")
If a path is provided, users are prompted to confirm their choice. This function will write the new path into toponym_options.rds in the package directory; the path is saved across sessions.
To locate toponym_options.rds, enter:
system.file("extdata", package = "toponym")
To check the path that is currently set, enter:
toponymOptions()
A character string indicating the current path for downloaded data.
if(interactive()){
# Set the path to the temporary directory
# Users are prompted to confirm their choice.
# Upon confirmation, toponym_options.rds will be edited in the package directory
toponymOptions(toponym_path = tempdir())
# Show the current path
toponymOptions()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.