| ch_safe_GET | R Documentation |
Executes GET function with error trapping
ch_safe_GET(url = NULL, filename = NULL)
url |
Required. URL to be accessed. |
filename |
Required. File to be used to save data |
Returns a character string: "OK" if all went well, the error message if it did not.
Kevin Shook
# Not tested automatically as can be very slow
test_url <- "https://zenodo.org/record/4781469/files/sm_data.csv"
dir_name <- tempdir(check = FALSE)
if (!dir.exists(dir_name)) {
dir.create(dir_name, recursive = TRUE)
}
test_file <- file.path(dir_name, "gs_dem25.tif")
result <- ch_safe_GET(test_url, test_file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.