运行示例时,Rayshader plot_gg崩溃 [英] Rayshader plot_gg crashes while running example

查看:71
本文介绍了运行示例时,Rayshader plot_gg崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已尝试从 https://www.rayhader示例中重现.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行时,出现以下错误消息:

but running the plot_gg line i get following error message:

if(哪一类%in%c("text","line")){错误:参数长度为零

关于那里发生的事情有什么想法吗?

Any idea on what's going on there?

推荐答案

将代码修改为:

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)

这篇关于运行示例时,Rayshader plot_gg崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆