尝试在运行 Sonoma 14.5 的 Mac 上运行该示例。我正在运行 R v4.4.0。所有软件包均已安装,没有错误。
library(rayshader)
library(ggplot2)
library(tidyverse)
library(sf)
library(viridis)
nc = st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE)
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)
最后一个命令返回:
Error in { :
task 1 failed - "object '_rayshader_rayshade_multicore' not found"
感谢两位提供意见的人。我找到了答案:我没有安装 XQuartz。从 XQuartz 主页:
brew install --cask xquartz
重新启动计算机和 RStudio,它也为我运行。