我尝试复制来自https://www.tylermw.com/3d-ggplots-with-rayshader/的以下光线着色器示例:
library(rayshader)
library(ggplot2)
library(tidyverse)
library(sf)
library(viridis)
nc = st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
gg_nc = ggplot(nc) +
geom_sf(aes(fill = AREA)) +
scale_fill_viridis("Area") +
ggtitle("Area of counties in North Carolina") +
theme_classic()
plot_gg(gg_nc, multicore = TRUE, width = 6 ,height=2.7, fov = 70)但是,运行plot_gg行将得到以下错误消息:
if中的错误(% c("text",“line”)中的%类型){:参数长度为零
知道那里发生了什么事吗?
发布于 2020-04-22 15:07:11
修改代码以:
theme_set(theme_classic())
gg_nc = ggplot(nc) +
geom_sf(aes(fill = AREA)) +
scale_fill_viridis("Area") +
ggtitle("Area of counties in North Carolina")
plot_gg(gg_nc, multicore = TRUE, width = 6 ,height=2.7, fov = 70)https://stackoverflow.com/questions/61263862
复制相似问题