cloudstan_url <- function(path = "") {
paste0("https://cloudstan.hercog.si", path)
}
os_is_windows <- function() {
isTRUE(.Platform$OS.type == "windows")
}
os_is_macos <- function() {
isTRUE(Sys.info()[["sysname"]] == "Darwin")
}
get_os <- function() {
if(os_is_windows()) {
"windows"
} else if(os_is_macos()) {
"darwin"
} else{
"linux"
}
}
download_with_retries <- function(download_url,
destination_file,
retries = 5,
pause_sec = 5,
quiet = TRUE) {
download_rc <- 1
while (retries > 0 && download_rc != 0) {
try(
suppressWarnings(
download_rc <- utils::download.file(url = download_url,
destfile = destination_file,
quiet = quiet,
method = "curl")
),
silent = TRUE
)
if (download_rc != 0) {
Sys.sleep(pause_sec)
}
retries <- retries - 1
}
download_rc == 0
}
strip_ext <- function(file) {
tools::file_path_sans_ext(file)
}
ask_for_confirmation <- function(msg = "Are you sure you want to proceed?") {
readline(paste(msg, "(y/n): ")) == 'y'
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.