Skip to content

Instantly share code, notes, and snippets.

## gganimate: gradually reveal underlying stripe image
library(jpeg)
library(grid)
library(ggplot2)
library(scales)
library(gganimate)
library(dplyr)
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
# Create a map of traces using Google Location History #
# get your google maps data:
# https://www.howtogeek.com/725241/how-to-download-your-google-maps-data/
library(dplyr) # data wrangling
library(lubridate) # date parsing
library(ggplot2) # plotting
library(jsonlite) # reading in json file
library(sf) # spatial
@ivabrunec
ivabrunec / andes.R
Created December 12, 2021 21:22
R code snippet: extract elevation matrix, clip it to a spatial polygon, render with rayshader
library(sf)
library(elevatr)
library(raster)
library(rayshader)
library(dplyr)
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
# read in andes shapefile from https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5466557/
# idk exactly what i'm doing yet
# get extent we're interested in