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(ggplot2);library(dplyr);library(lubridate) | |
foo <- read.csv("https://s3-us-west-2.amazonaws.com/econresearch/Reports/Core/RDC_InventoryCoreMetrics_Metro_Hist.csv", stringsAsFactors = FALSE) | |
foo <- foo %>% filter(CBSATitle == "Anchorage, AK") %>% | |
mutate(Date = ymd(Month), | |
Month = month(Month, lab = TRUE)) | |
# median price | |
ggplot(foo) + geom_line(aes(x = Date, y = Median.Listing.Price)) + theme_par() + ggtitle("Median Listing Price - Anchorage") + labs(caption = "source: http://research.realtor.com/data/inventory-trends") |
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
# NOTES BEFORE CONTINUING | |
# Problem 1. Time datatype for systems that go past midnight needs to have the right definition. So it won't work with trimet because it goes beyone midnight. | |
# Problem 2. Needs a service to find the correct projection to move from WGS84 to a local plane for accurate measurements in meters. Maybe I'm off here | |
# Problem 3. Since I set my machine up to need sudo commands for Postgres I don't know the best method as an admin to do database connections without sudo. | |
#system(paste("sudo -kS -u postgres psql -c 'CREATE DATABASE ", database_name, "'"), input=readline("Enter your password: ")) | |
#Variables to set | |
database_name <- "nameOfDatabase" | |
zipfile <- "zipfile/path" |
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(tigris) | |
dfw <- tracts(state = '02', county = '020', detailed = FALSE) | |
library(acs) | |
library(leaflet) | |
api.key.install("API_KEY" ) | |
income_data <- acs.fetch(endyear = 2012, |