Hi Alex,
Thanks very much for your suggestion. Unfortunately, I already had the integrator = “Riemann” argument and the function still fails over my large study area. My R = list in the rsf.select function is 5 elements (landcovers) totalling 40GB... Below is a simplified example of my current code which fails, with the following error and warning messages included.
However, when I run the same exact code, but crop the study area (what i use to build the list) to something like : Z00_cropped_10 = crop(
Classified_Map , extent(Z00_mv) * 10), (e.g., still 5 elements but totalling 600MB) the RSF works fine... Thus my curiosity if it would be appropriate to run cropped RSFs for each individual across different study area extents followed by mean to find population RSFs...
The failed code:
#My study area tif
Classified_Map <- rast(".../Classified_Map.tif")
#Factorizing
Classified_Map_factor = as.factor(
Classified_Map )
#making the list
Classified_Map_factor_list_selected <- list("bare_soil" = raster::raster(
Classified_Map_factor $prediction == 1),
"mudflats" = raster::raster(
Classified_Map_factor $prediction == 2),
"urban" = raster::raster(
Classified_Map_factor $prediction == 4),
"vegetation" = raster::raster(
Classified_Map_factor $prediction == 5),
"wetlands" = raster::raster(
Classified_Map_factor $prediction == 6) )
#loading all rasters in list to memory
Classified_Map_factor_list_selected <-lapply(
Classified_Map_factor_list_selected , raster::readAll)
#Minimum example with an individual named Z00
#Extracting individual points
Z00_Pts = points_telem$Z00
#loading AKDE
Z00_akde_phreml_weighted <- readRDS(here::here("Z00_akde_phreml_weighted.rds"))
start_time <- Sys.time()
Z00_RSF <- rsf.select(Z00_Pts,
Z00_akde_phreml_weighted , level.UD = 0.95,
R =
Classified_Map_factor_list_selected , integrator = "Riemann")
Sys.time() - start_time
Fitting RSF model isotropic ~ 0
Fitting RSF model isotropic ~ bare_soil
Error in eigen(sigma) : infinite or missing values in 'x'
In addition: Warning messages:
1: In .local(x, ...) :
This function is only useful for Raster* objects with a longitude/latitude coordinates
2: In .rasterFromRasterFile(grdfile, band = band, objecttype, ...) :
size of values file does not match the number of cells (given the data type)
3: In .local(x, ...) :
This function is only useful for Raster* objects with a longitude/latitude coordinates
4: In .rasterFromRasterFile(grdfile, band = band, objecttype, ...) :
size of values file does not match the number of cells (given the data type)
Thanks again for your help, dearest CTMM community!!
Philipp