
Data Scientist @CSGJC Formerly: @ACSNYC; @MOA_org; @StoryCorps; @endsmeatnyc_; @RobertasPizza Just here for the #rstats 📊📈💻
- Tweets1.3K
- Following323
- Followers420
- Likes2.2K

ALT library(tidycensus) library(dplyr) phx_flows <- get_flows( geography = "metropolitan statistical area", msa = 38060, geometry = TRUE ) phx_flows %>% filter(!is.na(GEOID2), variable == "MOVEDIN") %>% arrange(desc(estimate)) %>% head()
![#> Simple feature collection with 6 features and 7 fields #> Active geometry column: centroid1 #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: -112.0705 ymin: 33.18571 xmax: -112.0705 ymax: 33.18571 #> Geodetic CRS: NAD83 #> # A tibble: 6 x 9 #> GEOID1 GEOID2 FULL1_NAME FULL2_NAME variable estimate moe #> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> #> 1 38060 31080 Phoenix-Mesa-Scott~ Los Angeles-Long Be~ MOVEDIN 13605 1259 #> 2 38060 46060 Phoenix-Mesa-Scott~ Tucson, AZ Metro Ar~ MOVEDIN 11571 1074 #> 3 38060 16980 Phoenix-Mesa-Scott~ Chicago-Naperville-~ MOVEDIN 7675 1046 #> 4 38060 41740 Phoenix-Mesa-Scott~ San Diego-Carlsbad,~ MOVEDIN 5638 882 #> 5 38060 42660 Phoenix-Mesa-Scott~ Seattle-Tacoma-Bell~ MOVEDIN 5145 797 #> 6 38060 38900 Phoenix-Mesa-Scott~ Portland-Vancouver-~ MOVEDIN 4919 1073 #> # ... with 2 more variables: centroid1 <POINT [°]>, centroid](https://pbs.twimg.com/media/Ex6Bqb8XIAE0UA0.png?name=small&format=webp)
ALT #> Simple feature collection with 6 features and 7 fields #> Active geometry column: centroid1 #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: -112.0705 ymin: 33.18571 xmax: -112.0705 ymax: 33.18571 #> Geodetic CRS: NAD83 #> # A tibble: 6 x 9 #> GEOID1 GEOID2 FULL1_NAME FULL2_NAME variable estimate moe #> <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> #> 1 38060 31080 Phoenix-Mesa-Scott~ Los Angeles-Long Be~ MOVEDIN 13605 1259 #> 2 38060 46060 Phoenix-Mesa-Scott~ Tucson, AZ Metro Ar~ MOVEDIN 11571 1074 #> 3 38060 16980 Phoenix-Mesa-Scott~ Chicago-Naperville-~ MOVEDIN 7675 1046 #> 4 38060 41740 Phoenix-Mesa-Scott~ San Diego-Carlsbad,~ MOVEDIN 5638 882 #> 5 38060 42660 Phoenix-Mesa-Scott~ Seattle-Tacoma-Bell~ MOVEDIN 5145 797 #> 6 38060 38900 Phoenix-Mesa-Scott~ Portland-Vancouver-~ MOVEDIN 4919 1073 #> # ... with 2 more variables: centroid1 <POINT [°]>, centroid

ALT library(mapdeck) top_move_in <- phx_flows %>% filter(!is.na(GEOID2), variable == "MOVEDIN") %>% slice_max(n = 25, order_by = estimate) %>% mutate(width = estimate / 500) top_move_in %>% mapdeck(style = mapdeck_style("dark"), pitch = 45) %>% add_arc( origin = "centroid1", destination = "centroid2", stroke_width = "width" )


















