if (FALSE) {
library(ggplot2)
library(sf)
# Create sample sf data with dice values
nc <- st_read(system.file("shape/nc.shp", package = "sf"))
nc$dice <- sample(1:6, nrow(nc), replace = TRUE)
# Basic plot with dice
ggplot(nc) +
geom_sf() +
geom_dice_sf(sf_data = nc)
# Customized dice
ggplot(nc) +
geom_sf() +
geom_dice_sf(sf_data = nc, dice_color = "lightblue", dice_size = 5)
}
if (FALSE) {
library(ggplot2)
library(sf)
# Create sample sf data with dice values
nc <- st_read(system.file("shape/nc.shp", package = "sf"))
nc$dice <- sample(1:6, nrow(nc), replace = TRUE)
# Basic plot with dice
ggplot(nc) +
geom_sf() +
geom_dice_sf(sf_data = nc)
# Customized dice
ggplot(nc) +
geom_sf() +
geom_dice_sf(sf_data = nc, dice_color = "lightblue", dice_size = 5)
}
Run the code above in your browser using DataLab