set_EarthTime_Layers_Sheet: An Install the Default Layers EarthTime Sheet in Your...

Description Usage Arguments Examples

Description

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.

Usage

1
2
3
4
5
6
set_EarthTime_Layers_Sheet(
  spreadsheetId,
  GID,
  overwrite = FALSE,
  install = FALSE
)

Arguments

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 EarthTime_Layers_Sheet that you already have in your .Renviron file.

install

if TRUE, will install the key in your .Renviron file for use in future sessions. Defaults to FALSE.

Examples

 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)

andrewcberkley/EarthTimeR documentation built on Dec. 19, 2021, 3:33 a.m.