model <- readRDS(paste0(system.file("extdata",package="eva3dm"),
"/model.Rds"))
obs <- readRDS(paste0(system.file("extdata",package="eva3dm"),
"/obs.Rds"))
# if there is no observed data
# the function return an empty row
table <- eva(mo = model, ob = obs, site = "VVIbes")
print(table)
# if the site are not in the input data frame a message is displayed
# and the function return an empty row
table <- eva(mo = model, ob = obs, site = "Ibirapuera")
print(table)
# calculating statistical with a few observed values
table <- eva(mo = model, ob = obs, site = "Americana")
print(table)
# calculating categorical (using 2 for threshold) with a few observed values
table <- eva(mo = model, ob = obs, site = "Americana",
eval_function = cate, threshold = 2)
print(table)
# calculating categorical (using 2 for threshold) with a few observed values
table <- eva(mo = model, ob = obs, site = "Americana",
eval_function = cate, threshold = 10)
print(table)
# customizing the evaluation function: inclusion of p.value from stats::cor.test()
stat_p <- function(x, y, ...){
table <- eva3dm::stat(x, y, ...)
cor.result <- stats::cor.test(x, y, ... )
table$p.value <- cor.result$p.value
table <- table[,c(1:4,12,5:11)]
return(table)
}
table <- eva(mo = model, ob = obs, site = "Americana",eval_function = stat_p)
print(table)
Run the code above in your browser using DataLab