Open bbarker505 opened 3 years ago
Hello bbarker505,
How did you solve this issue? I am having the same problem even when following the step-by-step guide. Do you have an example?
Thank you
Hi @madeka772,
The only solution I found was to change the path of where my projection variables were located. I'll try to given an example. Let's say my project directory is in "/home/species/ENMTML". So here are the paths to my predictor and projection variables, respectively:
/home/species/ENMTML/Predictors/ /home/species/ENMTML/Projection/World
I was getting that error when I didn't have my projection variables within a subfolder inside of the "Projection" folder, which is very strange and something I recommended that should be changed in future ENMTML versions. In other words, I would get that error if my projection variables were in "/home/species/ENMTML/Projection/".
Hi, thanks for responding to me. I appreciate it. I am getting the same error even with the changes to my directory folders though, so I am not sure how to proceed from here.
ENMTML( pred_dir = 'C:/Users/Owner/Desktop/ENMTML/Predictors', proj_dir = 'C:/Users/Owner/Desktop/ENMTML/Projection/World', result_dir = 'C:/Users/Owner/Desktop/ENMTML/Results', occ_file = occ1, sp = 'A_Clade', x = 'x', y = 'y', min_occ = 208, thin_occ = NULL, eval_occ = NULL, colin_var = NULL, imp_var = TRUE, sp_accessible_area = c(method='USER-DEFINED', filepath='C:/Users/Owner/Desktop/AnthraxClades/AClade/Accessible Area Folder'), pseudoabs_method = c(method = 'RND'), pres_abs_ratio = 1, part=c(method='BOOT', replicates='10', proportion='0.7'), save_part = FALSE, save_final = TRUE, algorithm = c('SVM', 'RDF', 'MXD'), thr = c(type='MAX_TSS'), msdm = NULL, ensemble = c(method='W_MEAN', metric='TSS'), extrapolation = TRUE, cores = 1 )
Hi
In the "proj_dir" argument you must write the path to the folder with subfolders projection scenarios. It is mandatory that only environmental data files (e.g. .tif files) are included in each of the projection folders.
Hi,
What if I do not have multiple scenarios? Currently, I am working with 13 buffered rasters (.tif) and 13 global projection rasters all in the same .tif format with identical names.
The same rule, even if you have only one scenario you will have to leave the data in a subfolder.
El lun, 30 ago 2021 a las 17:15, madeka772 @.***>) escribió:
Hi,
What if I do not have multiple scenarios? Currently, I am working with 13 buffered rasters (.tif) and 13 global projection rasters all in the same .tif format with identical names.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/andrefaa/ENMTML/issues/329#issuecomment-908660240, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGW3YWGTSFVREF3SORWEMZDT7PRFVANCNFSM46BXNQVQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
--
Santiago J. E. Velazco, PhD
Postdoctoral researcher.
Department of Botany and Plant Sciences. University of California - Riverside
https://twitter.com/Santiag43066556 https://www.researchgate.net/profile/Santiago_Velazco3 https://orcid.org/0000-0002-7527-0967
Can you provide an example, please? I understand the concept of putting the data into a subfolder (I have used kuenm in the past).
C:\Users\Owner\Desktop\ENMTML\Projection\World.....do I need to add additional sub-folders?
Yes
Below there is an example.
require(ENMTML) require(raster)
getwd() #' Working directory of R session d_ex <- file.path(getwd(), 'ENMTML_example') d_ex dir.create(d_ex)
data("occ") d_occ <- file.path(d_ex, 'occ.txt') utils::write.table(occ, d_occ, sep = '\t', row.names = FALSE)
data("env") d_env <- file.path(d_ex, 'current_env_var') dir.create(d_env) raster::writeRaster(env, file.path(d_env, names(env)), bylayer=TRUE, format='GTiff')
data("env_fut") d_fut <- file.path(d_ex, 'future_env_var') dir.create(d_fut)
d0 <- file.path(d_fut, names(env_fut))[1] sapply(d0, dir.create)
raster::writeRaster(env_fut$2080_4.5
, file.path(d0[1],
names(env_fut$2080_4.5
)), bylayer=TRUE, format='GTiff', )
2080_8.5
, file.path(d0[2],#
names(env_fut$2080_8.5
)), bylayer=TRUE, format='GTiff')
data("ecoregions") d_eco <- file.path(d_ex, 'ecoregions') dir.create(d_eco) d_eco <- file.path(d_eco, paste0('eco','.shp')) shapefile(ecoregions, d_eco)
rm(list = c('d0', 'd_ex', 'ecoregions', 'env', 'env_fut', 'occ'))
args(ENMTML)
that will be used d_occ # file path with species occurrences d_env # directory path with current environmental conditions (raster in tiff format)
d_fut # directory path with folders with future environmental conditions (raster in tiff format) d_eco # file path with shapefile used to constrain models
ENMTML( pred_dir = d_env, proj_dir = d_fut, result_dir = NULL, occ_file = d_occ, sp = 'species', x = 'x', y = 'y', min_occ = 10, thin_occ = NULL, eval_occ = NULL, colin_var = c(method='PCA'), imp_var = FALSE, sp_accessible_area = c(method='BUFFER', type='2', width='500'), pseudoabs_method = c(method = 'RND'), pres_abs_ratio = 1, part=c(method= 'KFOLD', folds='2'), save_part = FALSE, save_final = TRUE, algorithm = c('SVM', 'RDF', 'MXD'), thr = c(type='MAX_TSS'), msdm = NULL, ensemble = c(method='PCA'), extrapolation = FALSE, cores = 1 )
El lun, 30 ago 2021 a las 17:24, madeka772 @.***>) escribió:
Can you provide an example, please? I understand the concept of putting the data into a subfolder (I have used kuenm in the past).
C:\Users\Owner\Desktop\ENMTML\Projection\World.....do I need to add additional sub-folders?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/andrefaa/ENMTML/issues/329#issuecomment-908667576, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGW3YWBTV5ZYYSVOWE5IADLT7PSJNANCNFSM46BXNQVQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
--
Santiago J. E. Velazco, PhD
Postdoctoral researcher.
Department of Botany and Plant Sciences. University of California - Riverside
https://twitter.com/Santiag43066556 https://www.researchgate.net/profile/Santiago_Velazco3 https://orcid.org/0000-0002-7527-0967
Thank you! My next question is in regards to an error I am receiving that has prevented me from completing the analysis. This is been a constant error when using the KFOLDS option with 3 partitions:
Error: Problem with summarise()
input Partition
.
x Calling var(x) on a factor x is defunct.
Use something like 'all(duplicated(x)[-1L])' to test for a constant vector.
i Input Partition
is stats::sd(Partition, na.rm = T)
.
i The error occurred in group 1: Sp = "anthrax", Algorithm = "RDF", Threshold = "MAX_TSS".
It seems to be an error caused by the R version. Which R version you are using?
El mié, 1 sept 2021 a las 12:07, madeka772 @.***>) escribió:
Thank you! My next question is in regards to an error I am receiving that has prevented me from completing the analysis. This is been a constant error when using the KFOLDS option with 3 partitions:
Error: Problem with summarise() input Partition. x Calling var(x) on a factor x is defunct. Use something like 'all(duplicated(x)[-1L])' to test for a constant vector. i Input Partition is stats::sd(Partition, na.rm = T). i The error occurred in group 1: Sp = "anthrax", Algorithm = "RDF", Threshold = "MAX_TSS".
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/andrefaa/ENMTML/issues/329#issuecomment-910376996, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGW3YWBALIMBDAOK4HWCAATT7Y6STANCNFSM46BXNQVQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
--
Santiago J. E. Velazco, PhD
Postdoctoral researcher.
Department of Botany and Plant Sciences. University of California - Riverside
https://twitter.com/Santiag43066556 https://www.researchgate.net/profile/Santiago_Velazco3 https://orcid.org/0000-0002-7527-0967
I am using R 1.4.1717, the newest version of the software.
Hi, I just have a suggestion for improving ease of use of ENMTML. I kept getting the error below, and finally figured out that it happened because there wasn't a subfolder contained within "proj_dir." My suggestion is that the program should work whether or not you have the projection variables in a subfolder vs. in the main "proj_dir" folder.
Error in ENMTML(pred_dir = pred_dir, proj_dir = proj_dir, result_dir = out_dir, : Select a folder containing folders with environment conditions for different regions or time periods, NOT a folder with this variables!