2

Running this script and getting the error: could not find function "plot_gg"

Tried uninstalling and installing ggplot2 again

Running 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)

Expecting a 3D graph but cannot see it. Getting could not find function "plot_gg"

zx8754
  • 52,746
  • 12
  • 114
  • 209
  • 2
    `rayshader` is still under heavy development (most recent commit to `plot_gg` was 6 days ago), please make sure that you have the newest version of it `devtools::install_github("tylermorganwall/rayshader")` – pogibas Jul 03 '19 at 15:25
  • Did what you said and got this?! Downloading GitHub repo tylermorganwall/rayshader@master trying URL 'https://cran.rstudio.com/bin/windows/Rtools/Rtools35.exe' Content type 'application/x-msdownload' length 108622512 bytes (103.6 MB) downloaded 103.6 MB Error: Failed to install 'rayshader' from GitHub: Could not find tools necessary to compile a package In addition: Warning messages: 1: In untar2(tarfile, files, list, exdir) : skipping pax global extended headers 2: In untar2(tarfile, files, list, exdir) : skipping pax global extended headers – Matthew Appleyard Jul 03 '19 at 15:31
  • 1
    It seems that rayshader has components that need to be compiled. I believe you will want to install Rtools first. Here is a link that may help. http://jtleek.com/modules/01_DataScientistToolbox/02_10_rtools – bdemarest Jul 03 '19 at 16:59

1 Answers1

1

If this happens and you previously had an older version of rayshader installed, sometimes (particularly on Windows) you will need to go to your library directory and delete the package manually. It's a problem that's also usually fixed by installing directly from the CRAN, once the binaries are built.

Tyler
  • 96
  • 3