everyone,
I'm trying to get a 3D map with the rayshader package, but apparently the file is too big to be processed by RStudio. Here is part of the code:
(...)
elevation = raster::merge(srtm,srtm2) #works fine
height_shade(raster_to_matrix(elevation)) %>% plot_map() #works fine
 
piecergb <- raster::stack(piece) #works fine
setValues(piecergb, scales::rescale(values(piecergb), to = c(0, 255)))
   Error: cannot allocate vector of size 11.9 Gb
So, I first checked the capacities of my RStudio:
memory.size()
[1] 27720.21
memory.limit()
[1] 2e+05 ###this I have previously changed with memory.limit(size=200000)
and called gc() to clean my session
gc()
            used   (Mb) gc trigger    (Mb)   max used    (Mb)
Ncells   2766617  147.8    4954078   264.6    4954078   264.6
Vcells 404719527 3087.8 3551300168 27094.3 3774733748 28799.0
I then restarted my RStudio, redefined the memory limit and tried again. But I still get the same error message. Does someone know what to do to fix this problem? I haven't found another solution so far and cannot proceed with the map.
My system info is:
Sys.info()
       sysname        release        version       nodename        machine          login           user effective_user 
     "Windows"       "10 x64"  "build 18363"        "NSF85"       "x86-64"      "install"      "install"      "install" 
Thank you so much in advance
Adriana
 
     
    