I am examining race in Monroe County, NY. I got an error code: ! Assigned data as.numeric(...) must be compatible with existing data.
Can you please help me address this issue?
Thank you in advance,
#The following is the R code I have used:
monroe_race <- get_decennial(
  geography = "tract",
  state = "NY",
  county = "Monroe",
  variables = c(
    Hispanic = "P2_002N",
    White = "P2_005N",
    Black = "P2_006N",
    Native = "P2_007N",
    Asian = "P2_008N"
  ),
  summary_var = "P2_001N",
  year = 2020,
  geometry = TRUE
) %>%
  mutate(percent = 100 * (value / summary_value))
monroe_black <- filter(monroe_race, 
                         variable == "Black")
tm_shape(shp = monroe_black) + 
  tm_polygons()
#But I got the message below:
Error:
! Assigned data as.numeric(...) must be compatible with existing data.
✖ Existing data has 211 rows.
✖ Assigned data has 210 rows.
ℹ Only vectors of size 1 are recycled.
Run rlang::last_error() to see where the error occurred.
Warning message:
The shape monroe_black contains empty units.
 
    

