# NOT RUN {
library(fgeo.tool)
assert_is_installed("fgeo.x")
# Example data
tree <- fgeo.x::tree6_3species
elevation <- fgeo.x::elevation
# Pick alive trees, of 10 mm or more
census <- filter(tree, status == "A", dbh >= 10)
# Pick sufficiently abundant species
pick <- filter(dplyr::add_count(census, sp), n > 50)
# Use your habitat data or create it from elevation data
habitat <- fgeo_habitat(elevation, gridsize = 20, n = 4)
# Defaults to using all species
as_tibble(
tt_test(census, habitat)
)
Reduce(rbind, tt_test(census, habitat))
some_species <- c("CASARB", "PREMON")
result <- tt_test(census, habitat, sp = some_species)
summary(result)
# }
Run the code above in your browser using DataLab