# Project "Settlements"
# Script nr. +Inf
# PUBLISH RESULTS DATA TO GD
# author: Petr Pajdla
# Pushes results csvs to GD
library(here)
library(tidyverse)
library(googledrive)
# upload results to GD -----------------------------------------------------
# # paths
# dt_result <- "analysis/data/derived_data/results"
# gd_path <- "~/settlements/data/results/"
#
# now <- paste("Updated", Sys.time())
# write_lines(now, here(dt_result, "README"), append = TRUE)
#
# # delete previous files
# drive_trash(filter(drive_ls(gd_path), str_detect(name, "^results.$")))
#
# # list files to upload
# files_local <- list.files(dt_result, pattern = "csv$", full.names = TRUE)
# readme <- list.files(dt_result, pattern = "^README$", full.names = TRUE)
#
# drive_results <- map(files_local, ~ drive_upload(.x, gd_path,
# type = "spreadsheet",
# overwrite = TRUE))
# drive_readme <- drive_upload(readme, gd_path, overwrite = TRUE)
# upload SI to GD ---------------------------------------------------------
# si <- here("analysis/paper/paper.html")
neo <- here("analysis/neo/neo.html")
traditions <- here("analysis/traditions/traditions.html")
groups <- here("analysis/groups/groups.html")
# drive_si <- drive_upload(si, "~/settlements/SI/", overwrite = TRUE)
drive_neo <- drive_upload(neo, "~/settlements/SI/", overwrite = TRUE)
drive_traditions <- drive_upload(traditions, "~/settlements/SI/", overwrite = TRUE)
drive_groups <- drive_upload(groups, "~/settlements/SI/", overwrite = TRUE)
# Figs to GD --------------------------------------------------------------
figs <- here("analysis/figures")
figs_up <- str_c(figs, "/", list.files(figs, pattern = "^res|^pca"))
map(figs_up, ~ drive_upload(.x, "~/settlements/figures/",
overwrite = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.