Description Usage Format Examples
Maunga Whau (Mt Eden) one of about 50 volcanos in the Auckland volcanic field. This dataset takes the volcano dataset and adds a primary sampling unit (PSU) and secondary sampling unit (SSU) onto the data so that it is suitable for cluster sampling examples.
1 |
A data frame with 4800 rows and 5 variables:
the x coordinate
the y coordinate
the elevation (in meters)
the primary sampling unit associated with an observation
the secondary sampling unit associated with an observation. These are 1-25 and nested within PSU
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(ggplot2)
library(dplyr)
# Plot the elevation
ggplot(Eden, aes(x=x, y=y, fill=elevation)) +
geom_tile()
# Plot the PSUs
PSU_labels <- Eden %>% group_by(PSU) %>% summarize(x=mean(x), y=mean(y), label=mean(PSU))
ggplot(Eden, aes(x=x, y=y, fill=(PSU-1) %/% 16)) +
geom_tile() +
geom_text( data=PSU_labels, aes(label=label))
# PSUs modulus 4 and 16 are geographically contiguous
Eden.PSU <- Eden %>% group_by(PSU) %>%
summarize(x=mean(x), y=mean(y))
ggplot(Eden, aes(x=x, y=y, fill=(PSU-1)%/%16)) +
geom_tile() +
geom_path(data=Eden.PSU)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.