I have created a lot of maps before without an issue and I am wondering if this is because of a simple update requirement or something similar. When I use ggplot + geom_stars for creating occurrence maps with spOccupancy prediction, I get a warning message and the map drawn does not capture details of the map.
"Warning message:
Removed 38051 rows containing missing values or values outside the scale range
(geom_raster()). "
Prediction is for 30910 non-sampled locations and I am confused where the 38051 is coming from. Projection used is NAD83, when I change it to UTM, the map doesn't even load and the error says "Error: cannot allocate vector size of xxx " which I know is due to memory but I do have more memory in the computer than it says it needs. Therefore, I am stuck. All other codes work and the analysis is complete, I just can't show it in the map. I have restarted a couple of times and cleared memory but nothing works. Any suggestions?
plot.codes <- sort(unique(y$FID))
# Maximum number of replicates at a site
K <- 2
# Number of sites
J <- length(unique(y$FID))
# Array for detection-non detection data.
ymat <- array(y$Join_Count, dim = c(J, K),)
# Look at the structure of our array y
str(ymat)
I have created a lot of maps before without an issue and I am wondering if this is because of a simple update requirement or something similar. When I use ggplot + geom_stars for creating occurrence maps with spOccupancy prediction, I get a warning message and the map drawn does not capture details of the map. "Warning message: Removed 38051 rows containing missing values or values outside the scale range (
geom_raster()
). "Prediction is for 30910 non-sampled locations and I am confused where the 38051 is coming from. Projection used is NAD83, when I change it to UTM, the map doesn't even load and the error says "Error: cannot allocate vector size of xxx " which I know is due to memory but I do have more memory in the computer than it says it needs. Therefore, I am stuck. All other codes work and the analysis is complete, I just can't show it in the map. I have restarted a couple of times and cleared memory but nothing works. Any suggestions?
Below is the code I used and files are attached:
Plot (site) codes.
Site covariate and coordinates
Format detection covs
Model
predicting throughout the landscape
for occurence
plotting occurence
base_coords500.csv base_data2.csv coords.csv occ_covs.csv SG_Spring_finaldata.csv