November 9, 2022
Last update: November 15. 2022
In preparation for the dumpster fire that is Oregon election reporting, I previously posed on importing a directory of .csv files. At present, that is what I can find to build this. What does the interface look like?
library(magick) Img <- image_read("./img/SShot.png") image_ggplot(Img) This is terrible, there is a javascript button to download each separately. Nevertheless, here we go.
Philadelphia Map
Use ggmap for the base layer.
library(ggmap); library(osmdata); library(tidyverse)
PHI <- get_map(getbb("Philadelphia, PA"), maptype = "stamen", zoom=12)
Get the Tickets Data
TidyTuesday covers 1.26 million parking tickets in Philadelphia.
tickets <- readr::read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-12-03/tickets.csv")
## Parsed with column specification:
## cols(
## violation_desc = col_character(),
## issue_datetime = col_datetime(format = ""),
## fine = col_double(),
## issuing_agency = col_character(),
## lat = col_double(),
## lon = col_double(),
## zip_code = col_double()
## )
Two Lines of Code Left
library(lubridate); library(ggthemes)
tickets <- tickets %>% mutate(Day = wday(issue_datetime, label=TRUE)) # use lubridate to extract the day of the month.
Searching and Mapping the Census
Searching for the Asian Population via the Census
To use tidycensus, there are limitations imposed by the available tables. There is ACS – a survey of about 3 million people – and the two main decennial census files [SF1] and [SF2]. I will search SF1 for the Asian population.
library(tidycensus); library(kableExtra)
library(tidyverse); library(stringr)
v10 <- load_variables(2010, "sf1", cache = TRUE)
v10 %>% filter(str_detect(concept, "ASIAN")) %>% filter(str_detect(label, "Female")) %>% kable() %>% scroll_box(width = "100%")
name
label
concept
P012D026
Total!
Hashtag OKBoomer
The generational banter that has followed the use of #OKBoomer reminded me of an interesting feature of US population data. I believe it to be true that Generation X has never and will never be the largest generation of Americans. There are tons of Millenials and Baby Boomers alike, though the rate of decline in the latter means that the former are about to surpass them. Or perhaps they have.
Pre-Talk
Slides
Set the RStudio to install blogdown.
install.packages("blogdown")
and to get a working local version of Hugo, the static site generator at the heart of this,
blogdown::install_hugo()
Motivation
Credit where credit is due; Alison Hill motivated all of this with her wealth of resources. Indeed, I redesigned the flow for today because of her brilliant R-Ladies Canberra seminar [I found the resource links on Twitter and the idea is
Ode to Griffin Park Griffin Park’s famous four corners make it the only football ground in England with four pubs on the four corners surrounding the ground.
Here’s a link to the curated twitter thread.
In the Beginning
The Griffin
To the Brook
The Brook
Sussex Best at the Brook
The Garden
Up New Road
The New Road Gate at Griffin Park
The New Inn
Doom Bar
Rules on the Main – Ealing – Road
Chris Fariss has some really neat data on international human rights that are really interesting to visualize for insight into the development of human rights over time. The data arise from measurement models applied to a variety of underlying indicators and they are presented in rather easy to work with forms. The basic structure is panel data. Let’s see what we have.
Fariss Data
Is neat and complete.