Hello,
I’m a beginner in R. I’m trying to get run ENMeval in order to objectively select a regularization multiplier. However, I get an error with the piece of code below.
Please I need your help.
Thank you in advance.
Johnny.
R version 3.3.3 (2017-03-06) -- "Another Canoe"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)
## set working directory
> setwd("C:/Users/...")
#load libraries ##
> library(ENMeval)
Loading required package: dismoLoading required package: rJavaLoading required package: parallelWarning message:package ‘ENMeval’ was built under R version 3.4.0
> library(raster)
Loading required package: sp
## import presence points
> pres <- read.csv("C:/...presence.csv")
## import rasters
> bio_2 <- raster("C:/.../bio_2.asc")
> bio_11 <- raster("C:/.../bio_11.asc")
> bio_15 <- raster("C:/.../bio_15.asc")
> bio_16 <- raster("C:/.../bio_16.asc")
> bio_17 <- raster("C:/.../bio_17.asc")
> bio_18 <- raster("C:.../bio_18.asc")
> bio_19 <- raster("C:/.../bio_19.asc")
## create raster stack
> my_stack <- stack(bio_2, bio_11, bio_15, bio_16, bio_17, bio_18, bio_19)
# create maxent arguments
> Reg_values <- c(seq(1.0, 4.0, 0.5))
> feature_classes <- c("LQH", "LQHP", "LQHT", "LQHPT")
##run ENMvaluate
> enmval_run <- ENMevaluate(pres, my_stack, RMvalues = Reg_values, fc = feature_classes, method = "randomkfold", kfolds = 5, n.bg = 10000, overlap = FALSE, bin.output = TRUE, clamp = TRUE)
Doing random k-fold evaluation groups...
Error: Failure during raster IO
In addition: Warning message:
In couldBeLonLat(mask2) : CRS is NA. Assuming it is longitude/latitude
Hi,Jamie,
Thank you for your time.
All the operations you mentioned work just fine.
I downloaded these rasters from WorldClim. I only did crop then convert them from .bil to .asc.
Quite frustrating L
--
You received this message because you are subscribed to the Google Groups "Maxent" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maxent+unsubscribe@googlegroups.com.
To post to this group, send email to max...@googlegroups.com.
Visit this group at https://groups.google.com/group/maxent.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to maxent+un...@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Maxent" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/maxent/FHtd5l2IlPQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to maxent+un...@googlegroups.com.
Doing random k-fold evaluation groups...
Warning: some predictors variables are NA at some occurrence points
|== | 4%
Error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 1, 2, 0
In addition: Warning message:
In couldBeLonLat(mask) : CRS is NA. Assuming it is longitude/latitude
Dear Jamie,
Goodness! you are right about the inputs! I just ran ENMevaluate smoothly. Silly me got things mixed up in the feature class vector.
I am very thankful for your time.
Best regards
Johnny.Warning: some predictors variables are NA at some occurrence points
Of 2 total cores using 2 Running in parallel... Error in { : task 1 failed - "arguments imply differing number of rows: 1, 2, 0"
I'm wondering if it is because of some predictor variables NA at some occurence points...
Thanks so much for yourhelp.
Best,
Marjolaine :-)
To unsubscribe from this group and all its topics, send an email to maxent+unsubscribe@googlegroups.com.
To post to this group, send email to max...@googlegroups.com.
Visit this group at https://groups.google.com/group/maxent.
For more options, visit https://groups.google.com/d/optout.