View twitterusers.py
This file contains 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
#!/usr/bin/python3 | |
import tweepy | |
import csv | |
consumer_key = "" | |
consumer_secret = "" | |
access_token = "" | |
access_token_secret = "" |
View metro.R
This file contains 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(tidycensus) | |
library(tidyverse) | |
# If not set, un-comment below and install your Census API key (https://api.census.gov/data/key_signup.html) | |
# census_api_key("YOUR KEY HERE", install = TRUE) | |
get_acs(geography = "metropolitan statistical area/micropolitan statistical area", | |
variables = "DP03_0021PE", | |
summary_var = "B01003_001", | |
survey = "acs1", |
View census_cleanup.R
This file contains 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(tidyverse) | |
library(tidycensus) | |
# My recommendation is to use the tidycensus library to make getting this data | |
# easier than reading in the data from the Census website. | |
# | |
# Before you can begin, you'll need to get an API key from the Census Bureau. | |
# You can acquire one here: | |
# | |
# Once you have the API key, run the following in RStudio: |
View messy.R
This file contains 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(charlatan) | |
library(salty) | |
library(magrittr) | |
library(readr) | |
messydata <- ch_generate('name','job','phone_number', n = 200) | |
messydata <- messydata %>% | |
mutate(job = salt_capitalization(job)) %>% | |
mutate(phone_number = salt_na(phone_number)) %>% |
View hex_logo.R
This file contains 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(hexSticker) | |
library(tidyverse) | |
library(tidycensus) | |
library(sf) | |
library(viridis) | |
options(tigris_use_cache = TRUE) | |
nebraska_raw <- get_acs(state = "NE", | |
geography = "tract", |
View frequency_to_list.R
This file contains 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(tidyverse) | |
library(readxl) | |
data <- readxl::read_xlsx("data.xlsx") | |
reshaped <- data %>% gather(word, freq, 2:21) | |
reshaped <- reshaped %>% drop_na() | |
cleaned <- reshaped %>% | |
uncount(freq) |
View geofilter.R
This file contains 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(tidyverse) | |
library(maps) | |
library(mapdata) | |
data <- read_csv("~/Desktop/nplsuperfund.csv") | |
names(data) <- c("lat","lon","date") | |
# Filter down to USA extent to remove extraneous points | |
tidy <- data %>% | |
filter(lat < -67, lat > -125) %>% |
View index.html
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<!-- D3.js --> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script> | |
<!-- Google fonts --> | |
<link href='https://fonts.googleapis.com/css?family=Cardo:400,400italic,700' rel='stylesheet' type='text/css'> |
View 2013MASTER.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
This file contains 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
reported,date,shooter,killed,wounded,location,article1,article2,article3,article4,article5,article6,article7,article8,article9 | |
,1/1/2013,Carlito Montoya,4,0,"Sacramento, CA",http://sanfrancisco.cbslocal.com/2013/01/12/3-young-men-teenage-boy-murdered-on-oakland-streets-in-6-hours-no-arrests/,http://hinterlandgazette.com/2013/01/oakland-gun-violence-ken-harbin-larry-lovette-eddiebo-rodriguez-4-killed-6hour-span.html,http://www.huffingtonpost.com/2013/01/12/oakland-shootings_n_2464783.html,,,,,, | |
,1/1/2013,Unknown,1,3,"Hawthorne, CA",http://losangeles.cbslocal.com/2013/01/01/man-killed-3-wounded-at-nye-party-in-hawthorne/,http://latimesblogs.latimes.com/lanow/2013/01/hawthorne-new-year-party-three-killed.html,,,,,,, | |
,1/1/2013,Julian Sims,0,4,"McKeesport, PA",http://pittsburgh.cbslocal.com/2013/01/01/4-people-shot-in-mckeesport/,http://www.wtae.com/news/local/allegheny/U-S-Marshals-task-force-arrests-New-Year-s-party-shooting-suspect/-/10927008/17977588/-/1ydqtj/-/index.html,,,,,,, | |
,1/1/2013,"Desmen Noble, Da |
View scc-tracts.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder