I am using the dismo predict function to predict the niche available to marine vertebrates in 2050. I have got a current and future oceanic pH dataset, my future dataset won't work within the predict function. I downloaded the data from noaa archive https://www.ncei.noaa.gov/archive/archive-management-system/OAS/bin/prd/jquery/accession/download/206289 https://www.ncei.noaa.gov/access/metadata/landing-page/bin/iso?id=gov.noaa.nodc:0206289
My current pH data works in the predict function, this data was from bio-ORACLE which has lead me to believe there is an issue with the form of the data from noaa.
This is the error code: SSL.testF.ph <- predict (phFuture, SSL.modF.ph) Error in .local(object, ...) : missing variables in Raster object
This is my code to create a species distribution model using bioclim and using these known current locations, produce a map showing the likelihood of occurrence in the future using dismo predict().
##stella sea lion (SSL) pH##
#where SSL could be located now
SSL.mod.ph <- bioclim(phCurrent, SSL.dat) #suitability of habitat
SSL.test.ph <- predict(phCurrent, SSL.mod.ph)
#plotting the likelihood of occurance
SSL.cur.ph <- plot(SSL.test.ph, ylab="Latitude", xlab= "Longitude", main = "suitable SSL habitat current pH") #this works
#where they could be in future conditions
SSL.modF.ph <- bioclim (phFuture, SSL.dat)
SSL.testF.ph <- predict (phFuture, SSL.modF.ph)
#Error in .local(object, ...) : missing variables in Raster object
I cannot work out how to solve this error code. I was expecting to produce a raster showing the likelihood of finding SSL in the future conditions just like I did for the current conditions. I have attempted the predict() with the future pH in a data.frame and character classes, but neither of these work. I also tried downloading it as a tar.gz formate but this didn't run either.
tarfile <- "0206289.1.2.tar.gz"
phFutureTar <- read.delim(file = untar(tarfile, compressed= "gzip"),sep= "\t")
SSL.testF.ph <- predict (phFutureTar, SSL.modF.ph)
I have considered loading the data in directly using rnoaa, however I cannot seem to access future pH data for 2050 directly through R studio. Does anyone know if downloading the data is the issue? and how I could access it another way?