# NOT RUN {
d <- droplet_create() %>% droplet_wait()
# Upgrade system packages
d %>%
droplet_ssh("apt-get update") %>%
droplet_ssh("sudo apt-get upgrade -y --force-yes") %>%
droplet_ssh("apt-get autoremove -y")
# Install R
d %>%
droplet_ssh("apt-get install r-base-core r-base-dev --yes --force-yes")
# Upload and download files -------------------------------------------------
tmp <- tempfile()
saveRDS(mtcars, tmp)
d %>% droplet_upload(tmp, "mtcars.rds")
tmp2 <- tempfile()
d %>% droplet_download("mtcars.rds", tmp2)
mtcars2 <- readRDS(tmp2)
stopifnot(all.equal(mtcars, mtcars2))
# }
Run the code above in your browser using DataCamp Workspace