## First a 1D example
library(sp)
set.seed(1)
data <- data.frame(x = runif(10)*10, y = 0, z= runif(10)*10)
coordinates(data) <- ~x+y
Grid1D_df <- auto_BAUs(manifold = real_line(),
cellsize = 1,
data=data)
if (FALSE) spplot(Grid1D_df)
## Now a 2D example
data(meuse)
coordinates(meuse) = ~x+y # change into an sp object
## Grid BAUs
GridPols_df <- auto_BAUs(manifold = plane(),
cellsize = 200,
type = "grid",
data = meuse,
nonconvex_hull = 0)
if (FALSE) plot(GridPols_df)
## Hex BAUs
HexPols_df <- auto_BAUs(manifold = plane(),
cellsize = 200,
type = "hex",
data = meuse,
nonconvex_hull = 0)
if (FALSE) plot(HexPols_df)
Run the code above in your browser using DataLab