# Create a random data set with 50 data points and 3 population groups
xy <- matrix(runif(100), ncol = 2)
pop <- matrix(runif(150), ncol = 3)
r1 <- spseg(xy, pop, smoothing = "kernel", maxdist = 0.5)
r2 <- spseg(xy, pop, smoothing = "kernel", useExp = FALSE,
power = 0, maxdist = 0.5)
print(r2, digits = 3)
# Auckland population data set
data(auckpop2006)
r3 <- spseg(auckpop2006, smoothing = "kernel", maxdist = 3000)
r4 <- spseg(auckpop2006, smoothing = "equal", maxdist = 100)
r5 <- spseg(auckpop2006, smoothing = "equal", maxdist = 3000)
r6 <- spseg(auckpop2006, smoothing = "kernel", nrow = 300, ncol = 300,
maxdist = 3000, verbose = TRUE)Run the code above in your browser using DataLab