Description Usage Arguments Examples
This function will add your EarthTime Layers sheet to your .Renviron
file so it can be called securely without being stored in your code. After you have installed your sheet, it can be called any time by typing Sys.getenv("EarthTime_Layers_Sheet")
and can be used in package functions by simply typing set_EarthTime_csv_layers() If you do not have an .Renviron
file, the function will create on for you. If you already have an .Renviron
file, the function will append the key to your existing file, while making a backup of your original file for disaster recovery purposes.
1 2 3 4 5 6 | set_EarthTime_Layers_Sheet(
spreadsheetId,
GID,
overwrite = FALSE,
install = FALSE
)
|
spreadsheetId |
Specify the name of the csv layer output from previous functions. |
GID |
Something that identifies a Google Sheet: its file ID, a URL from which we can recover the ID, an instance of googlesheets4_spreadsheet (returned by sheets_get()), or a dribble, which is how googledrive represents Drive files. Processed through as_sheets_id(). |
overwrite |
If this is set to TRUE, it will overwrite an existing |
install |
if TRUE, will install the key in your |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
if (FALSE) {
set_EarthTime_Layers_Sheet("xxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxx", "0123456789", install = TRUE)
#First time, reload your environment so you can use the key without restarting R.
readRenviron("~/.Renviron")
#You can check it with:
Sys.getenv("EarthTime_Layers_Sheet")
}
## End(Not run)
## Not run:
if (FALSE) {
# If you need to overwrite an existing key:
set_EarthTime_Layers_Sheet("xxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxx", "0123456789", install = TRUE)
# First time, relead your environment so you can use the key without restarting R.
readRenviron("~/.Renviron")
# You can check it with:
Sys.getenv("EarthTime_Layers_Sheet")
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.