Raster to matrix in R returns NA,Rayshader

121 Views Asked by At

So i am downloading the elevation data for a shapefile, which i have saved in my pc. But for some reason. I use this shapefile to download the elevation data in R using elevatr package. To plot this elevation data in raysahder,we need this to be converted into a matrix form but somehow all i get back is NAs. Heres the code:


arw = readOGR("Shape file/american water/American_River_Watershed.shp")
dem_arw =elevatr::get_elev_raster(arw,z = 10,clip = "location")
raster_to_matrix(dem_arw)

The output i get is NAs only or simple matrix number entries like: Nas or simple entries

I have tried other shapefiles too and updating the Rayshader package too but still i get this. This worked almost a week ago but now all of a sudden it doesn't. Please any help or suggestion would be much appreciated.

0

There are 0 best solutions below