# NOT RUN {
fdir <- system.file("NGAplants", package="phyloregion")
files <- file.path(fdir, dir(fdir))
raster2comm(files)
# }
# NOT RUN {
# }
# NOT RUN {
s <- readRDS(system.file("nigeria/nigeria.rds", package="phyloregion"))
sp <- random_species(100, species=5, shp=s)
polys2comm(dat = sp, species = "species")
# }
# NOT RUN {
s <- readRDS(system.file("nigeria/nigeria.rds", package = "phyloregion"))
set.seed(1)
m <- data.frame(sp::spsample(s, 10000, type = "nonaligned"))
names(m) <- c("lon", "lat")
species <- paste0("sp", sample(1:1000))
m$taxon <- sample(species, size = nrow(m), replace = TRUE)
pt <- points2comm(dat = m, mask = s, res = 0.5, lon = "lon", lat = "lat",
species = "taxon")
head(pt[[1]])
# }
Run the code above in your browser using DataLab