【问题标题】:Could not find function "plot_gg" from the rayshader package [closed]无法从光线着色器包中找到函数“plot_gg”[关闭]
【发布时间】:2019-11-14 07:59:25
【问题描述】:

运行此脚本并收到错误:找不到函数“plot_gg”

再次尝试卸载和安装ggp​​lot2

运行 3.6.0

library(rayshader)
library(ggplot2)
library(tidyr)

gg = ggplot(diamonds, aes(x, depth)) +
  stat_density_2d(aes(fill = stat(nlevel)), 
                  geom = "polygon",
                  n = 100,bins = 10,contour = TRUE) +
  facet_wrap(clarity~.) +
  scale_fill_viridis_c(option = "A")
plot_gg(gg,multicore=TRUE,width=5,height=5,scale=250)

期待 3D 图形,但看不到它。 获取找不到函数“plot_gg”

【问题讨论】:

  • rayshader 仍在大力开发中(最近对 plot_gg 的提交是 6 天前),请确保您拥有它的最新版本 devtools::install_github("tylermorganwall/rayshader")
  • 照你说的做了,得到了这个?!下载 GitHub 存储库 tylermorganwall/rayshader@master 尝试 URL 'cran.rstudio.com/bin/windows/Rtools/Rtools35.exe' 内容类型 'application/x-msdownload' 长度 108622512 字节 (103.6 MB) 已下载 103.6 MB 错误:无法从 GitHub 安装 'rayshader':找不到必要的工具编译包另外:警告消息:1:在 untar2(tarfile, files, list, exdir) 中:跳过 pax 全局扩展标头 2:在 untar2(tarfile, files, list, exdir) 中:跳过 pax 全局扩展标头跨度>
  • 看来rayshader有组件需要编译。我相信你会想先安装 Rtools。这是一个可能有帮助的链接。 jtleek.com/modules/01_DataScientistToolbox/02_10_rtools

标签: r ggplot2 rayshader


【解决方案1】:

如果发生这种情况并且您之前安装了较旧版本的 Rayshader,有时(尤其是在 Windows 上)您需要转到您的库目录并手动删除该包。一旦构建了二进制文件,通常也可以通过直接从 CRAN 安装来解决这个问题。

【讨论】:

    猜你喜欢
    • 2012-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多