Closed cmu002 closed 2 years ago
This is an issue with how ResistanceGA
is using gdistance
. I haven't had time to figure out a solution. Your data works fine when optimizing with Circuitscape in Julia. Download the latest version of ResistanceGA
devtools::install_github("ResistanceGA", build_vignettes = T)
There's a help document for installing and setting Julia and Circuitscape. The code below, following your code above, worked for me. Note that this was a short run to test the code.
# Use Julia ---------------------------------------------------------------
jl_home <- "C:/Users/peterman.73/AppData/Local/Programs/Julia-1.7.2/bin/"
jl_inputs <- jl.prep(n.Pops = length(sp.dat.reproj),
CS_Point.File = sp.dat.reproj,
response = lower(as.matrix(gen_dist)),
JULIA_HOME = jl_home)
GA.inputs <- GA.prep(ASCII.dir = r.stack,
Results.dir = write.dir ,
maxiter = 1,
pop.size = 5
# parallel = 14
)
SS_RESULTS.jl <- SS_optim(jl.inputs = jl_inputs,
GA.inputs = GA.inputs)
@wpeterman Thanks so much for the timely response! I've gotten it to work so far with Julia, so I'm going to close the issue. However, after digging around I noticed that this error is a common occurrence in the lme4
package when dealing with raster datasets. Rather strange how it worked on all of my other datasets, but occurred only on rasters I got from a third party...
G'day, I've been attempting to run some soil geochemistry rasters through the SS_optim function, however, I keep getting an error output of
Error in { : task 5 failed - "0 (non-NA) cases"
. I've sourced these datasets externally, however, they have the exact same extent/dimension/resolution as all previous datasets that have worked. This leads me to believe that there is something wrong with the actual raster, however, I can't seem to rectify the issue. Has anyone else come across this issue before in their.asc
files?Any advice would be greatly appreciated!
Data can be found here.
The full code used: