# NOT RUN {
library(raster)
file <- system.file("nigeria/nigeria.rds", package = "phyloregion")
d <- readRDS(file)
e <- extent(d)
set.seed(1)
m <- data.frame(lon = runif(1000, e[1], e[2]),
lat = runif(1000, e[3], e[4]),
sites = seq(1000))
coordinates(m) <- ~ lon + lat
z <- selectbylocation(m, d)
plot(d)
points(m, col = "blue", pch = "+")
points(z, col = "red", pch = "+")
# }
Run the code above in your browser using DataLab