Draw a US map at the block group level and map the corresponding data

Hello, I am going to draw one US map at the block group level and then map the Gini index values at the block group level. However, I only found a way to draw the map at the state or county level. Can you help me with it? Appreciate it.

# Load necessary library
library(tibble)
library(tidycensus)
library(tigris)
library(sf)

options(tigris_class = "sf")

# Create the data frame
data <- tibble(
  GEOID = c("010010201001", "010010201002", "010010202002", "010010203001", "010010203002", "010010204001"),
  Gini = c(0.709, 0.693, 0.608, 0.671, 0.595, 0.783)
)

# Print the data frame
print(data)
1 Like

{tigris} should provide the geometries you need with the block_groups() function