if (FALSE) {
file <- system.file("external/pa_df.csv", package="sdm")
df <- read.csv(file)
head(df)
d <- sdmData(sp~b15+NDVI,train=df)
d
#----
# Example 1: fit using 3 models, and no evaluation (evaluation based on training dataset):
m <- sdm(sp~b15+NDVI,data=d,methods=c('glm','gam','gbm'))
m
# Example 3: fit using 5 models, and
# evaluates using 10 runs of subsampling replications taking 30 percent as test:
m <- sdm(sp~b15+NDVI,data=d,methods=c('glm','gam','gbm','svm','rf'),
replication='sub',test.percent=30,n=10)
m
# Example 3: fits using 5 models, and
# evaluates using 10 runs of both 5-folds cross-validation and bootsrapping replication methods
m <- sdm(sp~.,data=d,methods=c('gbm','tree','mars','mda','fda'),
replication=c('cv','boot'),cv.folds=5,n=10)
m
# Example 4: fit using 3 models; evaluate the models using subsampling,
# and override the default settings for the method brt:
m <- sdm(sp~b15+NDVI,data=d,methods=c('glm','gam','brt'),test.p=30,
modelSettings=list(brt=list(n.trees=500,train.fraction=0.8)))
m
}
Run the code above in your browser using DataLab