I am a marine biology student and currently trying to model the biofouling (mussels, anemones etc) on drilling platforms in the North Sea. I am trying to continue the work of a previous student who has worked on this subject. She created a RasterStack of environmental parameters of the North Sea, to compare to species occurrence. I am currently trying to add a raster of bathymetry to this rasterstack.
She originally downloaded .xyz files from EMODnet: http://portal.emodnet-bathymetry.eu/?menu=19#
And loaded them into RStudio with the following line of code:
B2 <- read_delim("~/R/Data input/Environmental data/Bathymetry/B2.xyz", ";", escape_double = FALSE, col_names = FALSE, trim_ws = TRUE)
X1 = col_double(),
X2 = col_double(),
X3 = col_double(),
X4 = col_character()
When I try to do this, R returns the error:
Cannot read file D:/Users/ELBM/Documents/R/Bathymetry/B2.xyz: Not enough storage is available to process this command.
This does not happen with the file of a section of the North Sea that's only 458.8 MB, it does happen with three other files, which are 2.1 GB, 1.4 GB and 1 GB. I have 20 free GB on the D drive left and 80 GB free on the C drive so a lack of space should not be the problem? I have tried altering IRPStackSize to 25 in regedit.exe, which did not help. If anyone knows how to solve this error, that would be awesome!
I have also tried to create this raster/map in an alternative way. EMODnet lets you download smaller sections, which I've done, but then turns them into ASCII grids. I can load these into R with the following line of code:
AsciiBat1 <- read.asciigrid("~/R/Bathymetry/AsciiBat1.asc")
which turns them into Large SpatialGridDataFrames. Looks like this when I plot one:
However, in order for them to be useful, I need to combine all the sections of the North Sea into one map/raster. I've tried to google how to do this, but I'm a total coding beginner and trial&error has gotten me nowhere. How do I combine multiple SpatialGridDataFrames into one? Or turn them into a table or matrix, after which I can combine them and turn them into a spatialgriddataframe again?
I've gotten in way over my head, the step from the R introduction course from datacamp to this was a bit too big. Hope anyone can help me!