(This is my first attempt to use R, so I apologize for any stupidity. Also, please let me know if this is better posted in Stack Overflow.)
options(tigris_class = "sf", tigris_use_cache = TRUE) zctas_national <- zctas(cb = TRUE) selected_zip <- zctas_national %>% filter(ZCTA5CE10 %in% c(02139))
When I try to
print(selected_zip), I get nothing back. Or rather, I get a table that looks like this:
 ZCTA5CE10 AFFGEOID10 GEOID10 ALAND10 AWATER10 geometry <0 rows> (or 0-length row.names)
If I replace 02139 with 85308 (the zip from the gist), everything is fine:
ZCTA5CE10 AFFGEOID10 GEOID10 ALAND10 AWATER10 1 85308 8600000US85308 85308 44254346 872904
Anyone know what's going on?