Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 如何将此光线着色器打印转换为Gif?_R_Ggplot2_Gif_Usmap_Rayshader - Fatal编程技术网

R 如何将此光线着色器打印转换为Gif?

R 如何将此光线着色器打印转换为Gif?,r,ggplot2,gif,usmap,rayshader,R,Ggplot2,Gif,Usmap,Rayshader,我用rayshader绘制了这张很酷的地图,用来绘制该县的工业用水量。但我不知道如何从用鼠标移动的绘图变成Gif。以下是非Gif光线着色器打印的代码: library(tidyverse) library(devtools) devtools::install_github("tylermorganwall/rayshader") library(rayshader) library(usmap) water <- read.csv("water.csv", header = TRUE

我用rayshader绘制了这张很酷的地图,用来绘制该县的工业用水量。但我不知道如何从用鼠标移动的绘图变成Gif。以下是非Gif光线着色器打印的代码:

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)
库(tidyverse)
图书馆(devtools)
devtools::install_github(“tylermorganwall/rayshader”)
库(光线着色器)
图书馆(美国地图)

从github页面上看,似乎
render\u movie
函数应该有助于实现这一点。它创建了一个mp4文件,但应该有很多工具可以将其转换为gif或类似的格式(现在网络上的很多“gif”实际上不是.gif格式,.gif非常重,正在慢慢被替换)