I made this cool map with rayshader to plot the amount of industrial water use by the county. But I don't know how to go from plot you move with the mouse to a Gif. Here's the code for the non-Gif Rayshader plot:
library(tidyverse)
library(devtools)
devtools::install_github("tylermorganwall/rayshader")
library(rayshader)
library(usmap)
water <- read.csv("water.csv", header = TRUE,
check.names = FALSE,
stringsAsFactors=FALSE)
#usmaps needs a fips value
water <- water %>%
rename(fips = FIPS)
#"IN-Wtotl" is just total industrial water use
water <- water %>%
select("COUNTY","fips","IN-Wtotl")
#Get the 2D map
plotmap <-
plot_usmap(data = water,
values = "IN-Wtotl",
lines = FALSE,
labels = FALSE) +
scale_fill_continuous(high = "#D62828",
low = "#252158",
na.value= "lightgray",
name = "Industrial water use (Mgal/d)",
label = scales::comma)+
theme(legend.position = "right") +
theme(text = element_text(family="Arial", face="bold"))
#Get the sweet rayshader action
plot_gg(plotmap,multicore = TRUE, width = 7, height = 4, fov = 100, scale = 300, zoom = .25)
I have no idea where to go from here in terms of getting it to the gif stage. Anyone have suggestions? The documentation on this isn't great, just like three github pages with a lot of code and finished results without explaining what's happening. Anyway if someone can help out that'd be cool.