Add [[indexedsearch]] to mediagoblin.ini
🐻❄️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(rdrop2) # devtools::install_github("karthik/rdrop2") | |
| library(dplyr) | |
| top_level_path <- function(x){ | |
| stringr::str_extract(x, "^(.+?)(\\/)") | |
| } | |
| rdrop2::drop_auth() | |
| file_list_raw <- drop_dir(recursive = TRUE) |
moved to https://codeberg.org/jsta/gists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #' Download files from Zenodo record id | |
| #' | |
| #' @param record_id record id | |
| #' @param dest_folder destination folder for file downloads | |
| #' @param token API key | |
| #' | |
| #' @details https://github.com/zenodo/zenodo/issues/1629#issuecomment-435062462 | |
| #' | |
| #' @importFrom httr GET content | |
| #' @importFrom jsonlite fromJSON |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(raster) | |
| library(elevatr) | |
| library(rayshader) | |
| library(reshape2) | |
| library(ggplot2) | |
| data(lake) | |
| x <- get_elev_raster(lake, z = 12) | |
| x_mat <- as.matrix(x) | |
| x_rsh <- rayshader::rayshade(x_mat, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(rvest) | |
| library(ggplot2) | |
| url <- "https://coastwatch.glerl.noaa.gov/statistic/statistic.html" | |
| html <- read_html(url) | |
| data_links <- html_attr(html_nodes(html, "table:nth-child(3) td a"), "href") | |
| table_header <- readLines(paste0(gsub(basename(url), "", url), | |
| data_links)[1])[6] | |
| table_header <- unlist(strsplit(strsplit(table_header, " ")[[1]], " ")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # GLEON lakes according to Wikipedia | |
| library(rvest) | |
| library(wikilake) | |
| library(sf) | |
| library(maps) | |
| # get data #### | |
| gleon_lakes <- read_html("http://gleon.org/lakes") | |
| gleon_lakes <- html_nodes(gleon_lakes, ".views-field") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(wikilake) | |
| library(wbstats) | |
| library(dplyr) | |
| dt <- lake_wiki("Loch Ness") | |
| loch_volume <- as.numeric(substring(dt$`Water volume`, 0, 3)) | |
| pop_data <- wb(indicator = "SP.POP.TOTL", startdate = 2016, enddate = 2017) | |
| pop_data <- filter(pop_data, country == "World") |