0

I am currently trying to make a biosfile prior to running maxent but keep getting faced with this error: I wonder if anyone has faced this issue before and fixed it please?

bg <- xyFromCell(dens.ras2speciesocc,
      sample(which(!is.na(values(subset(env, 1)))), 10000,
  prob=values(dens.ras2speciesocc)[!is.na(values(subset(env, 1)))])) -- this runs fine and then: 

enmeval_resultsspeciesocc <- ENMevaluate(speciesocc, env,
                                           method= "randomkfold", kfolds = 10, algorithm='maxent.jar', bg.coords = bg)

Which returns this error:

'Error in ENMevaluate(speciesocc, env, method = "randomkfold", kfolds = 10,  : 
  unused argument (kfolds = 10)'

Does anyone have any idea?

Sabaoon Bedar
  • 3,113
  • 2
  • 31
  • 37

2 Answers2

0

from link:

occ, env, bg.coords, RMvalues, fc, occ.grp, bg.grp, method, bin.output, rasterPreds, clamp, progbar: These arguments from previous versions are backward-compatible to avoid unnecessary errors for older scripts, but in a later version these arguments will be permanently deprecated.

Neperin
  • 13
  • 3
  • Generally an answer should be more than pointing to a link. Are you sure it is relevant? The error message is about `kfold` parameter which is not mentioned here. – Peter Koltai Aug 01 '21 at 08:51
0

I was having the same issue and then removed the kfolds argument to see if the default (kfolds=5) would run and I got this message instead:

    Error in ENMevaluate(occ, env, method = "randomkfold", algorithm = "maxent.jar",  : 
    Datasets "occs" and "bg" have different column names. Please make them identical and try again.

Then I checked my bg column and it was 'x' and 'y' instead of 'longitude' and 'latitude' that I had for my occ file.

That didn't solve it - it went back to giving me the initial error message - but I am sure it was also contributing to the problem!

BUT THEN,

I looked into RMvalue(regularisation multipliers) and fc (feature class) and added them to the code, like this:

    enmeval_results <- ENMevaluate(occ, env, bg.coords = bg, method = 'randomkfold',
                           RMvalues = seq(0.5, 4, 0.5),
                           fc = c("L", "LQ", "H", "LQH", "LQHP", "LQHPT"),
                           algorithm='maxent.jar')

and it worked! Obviously, change the fc and RMvalues to what suits you best. I hope this works for you too! Angeliki