This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Start with the code and data here: https://github.com/fivethirtyeight/data/blob/master/police-deaths/plot.R | |
| ## Then: | |
| ## Calculate total deaths by year | |
| dat <- data_for_plot %>% | |
| group_by(year) %>% | |
| mutate(total = sum(count)) | |
| ## Colors I chose | |
| mycolors <- c("#00bf7b", "#59004d", "#ffcb89", "#a76e61", "#ac270d", "#7890ff", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Follower accession chart for AMPADportal | |
| ## Inspired by: https://blog.ouseful.info/2013/04/05/estimated-follower-accession-charts-for-twitter/ | |
| library("rtweet") | |
| library("tidyverse") | |
| followers <- get_followers("AMPADPortal") | |
| followers_df <- lookup_users(followers$user_id) | |
| process_user_data <- function(data) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library("cholera") | |
| library("tidyverse") | |
| library("magick") | |
| library("grid") | |
| library("egg") | |
| # Get image | |
| bree <- image_read("https://pbs.twimg.com/media/EBPHuylUIAAziJt?format=jpg") | |
| # Add x/y coordinates of Broad St. pump and convert format |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ############################################ | |
| #### Calculate number of code reviews #### | |
| ############################################ | |
| ## Needs a GitHub PAT or you'll hit rate limiting | |
| library("gh") | |
| library("purrr") | |
| library("glue") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ####################### | |
| #### Reprex demo #### | |
| ####################### | |
| ## 2020-04-24 | |
| # A simple reprex -------------------------------------------------------------- | |
| dat <- data.frame(a = 1:2, b = LETTERS[1:2]) | |
| mean(dat$a) |
OlderNewer