0

I'm trying to use the rayshader package in R to plot elevation data, but I'm getting an error when I call the plot_map() function. I can't even get the example to run without running into the following error. Any ideas on how to get this function to run?

error in evaluating the argument 'x' in selecting a method for function 'plotRGB': unused argument (asp = 1)

Here is the example code that I am calling.

library(rayshader)

#Here, I load a map with the raster package.
loadzip = tempfile() 
download.file("https://tylermw.com/data/dem_01.tif.zip", loadzip)
localtif = raster::raster(unzip(loadzip, "dem_01.tif"))
unlink(loadzip)

#And convert it to a matrix:
elmat = raster_to_matrix(localtif)

#We use another one of rayshader's built-in textures:
elmat %>%
  sphere_shade(texture = "desert") %>%
  plot_map()
  • I have tried your code and everything works fine and it showed the map fine. Do you have the latest working release of the `rayshader` package? – John Manacup Oct 05 '22 at 08:12
  • Same here, everything worked fine – dieghernan Oct 05 '22 at 10:03
  • Yes, I'm using latest version of rayshader (0.28.11). I suspect the problem may have to do with the fact that I'm running on Mac and/or XQuartz, which I needed to install to successfully load the package on my Mac in the first place. I am able to run the code successfully on a Windows workspace. – cullenmac Oct 05 '22 at 14:36

0 Answers0