## Background setwd("/Users/town/Documents/Kansas_Herps/NewAnalyses/ATP_KUENM/Pseu_cruc/AnalysisKUENM/") background=read.csv("Background3.csv") background=na.omit(background) background[1:10,1:6] write.csv(background,"BackgroundFiles/Set_1.csv",row.names=FALSE) Set_2=c(colnames(background)[1:3],"aspect_lulc","dem_lulc","slope_lulc") Set_3=c(colnames(background)[1:3],"aspect_lulc","dem_lulc","slope_lulc","klcp2005_lulc") SoilVars=list.files("/Users/town/Documents/Kansas_Herps/NewAnalyses/ATP_KUENM/Ples_lati/M_variables/4_Soil/",pattern=".asc$") SoilVars=gsub(".asc$","",SoilVars) Set_4=c(colnames(background)[1:3],SoilVars) Set_5=c(Set_2,SoilVars) Set_6=c(Set_4,"klcp2005_lulc") write.csv(background[,Set_2],"BackgroundFiles/Set_2.csv",row.names=FALSE) write.csv(background[,Set_3],"BackgroundFiles/Set_3.csv",row.names=FALSE) write.csv(background[,Set_4],"BackgroundFiles/Set_4.csv",row.names=FALSE) write.csv(background[,Set_5],"BackgroundFiles/Set_5.csv",row.names=FALSE) write.csv(background[,Set_6],"BackgroundFiles/Set_6.csv",row.names=FALSE) #Ready for running KUENM library(kuenm) kuenm_cal_swd(occ.joint = "Pseu_cruc_all4.csv",occ.tra = "Pseu_cruc_cal4.csv",occ.test = "Pseu_cruc_eval4.csv", back.dir = "BackgroundFiles/",batch = "batchfile",out.dir.models = "output_candidatemodels", reg.mult = c(0.1,0.3,0.5,0.7,0.9,1,2,3,4,5,7),f.clas = "all",maxent.path = "/Applications/maxent/", selection = "OR_AICc",out.dir.eval = "output_evaluation") ##PROJECTION ##Create directory structure and load files within kuenm_mod_swd(occ.joint = "Pseu_cruc_all4.csv",back.dir = "BackgroundFiles/",out.eval = "output_evaluation/", batch = "batch_final",rep.type = "Bootstrap",out.format = "cloglog",project = TRUE, G.var.dir = "G_variables/",ext.type = "all",maxent.path = "/Applications/maxent/",out.dir = "finalmodels")