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
install.packages("jsonlite", dependencies = TRUE) | |
install.packages("RCurl", dependencies = TRUE) | |
library("jsonlite") | |
library("RCurl") | |
base_url <- "https://api.parsely.com/v2" | |
apikey <- "computerworld.com" | |
api_secret <- "YOUR SECRET KEY" |
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
## Mapping household income by ward in South Africa - data from the 2011 Census | |
## Author: Kyle Walker. Please share and re-use as much as you'd like! | |
library(readxl) | |
library(rgdal) | |
library(dplyr) | |
library(tidyr) | |
library(magrittr) |
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/env ruby | |
require 'mail' | |
mysql_username = 'root' | |
mysql_password = '123456' | |
mysql_database = 'test' | |
system("mysqldump --user=#{mysql_username} --password=#{mysql_password} #{mysql_database} > backup.sql") | |
# Credit to : |
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(googleAuthR) | |
## set scopes for calendar | |
options(googleAuthR.scopes.selected = "https://www.googleapis.com/auth/calendar.readonly", | |
googleAuthR.client_id = "XXXX", ## add your Google project client Id | |
googleAuthR.client_secret = "XXXX") ## add your Google project client secret | |
## make sure calendar API is activated for your Google Project at below URL: | |
# https://console.cloud.google.com/apis/api/calendar-json.googleapis.com/overview |
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(leaflet) | |
library(sf) | |
library(viridis) | |
options(tigris_use_cache = TRUE) | |
il1 <- get_acs(geography = "county", | |
variables = c(hhincome = "B19013_001"), | |
state = "IL", | |
geometry = TRUE) %>% |
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(chunked) | |
library(tidyverse) | |
# I want to look at the daily page views of Wikipedia articles | |
# before 2015... I can get zipped log files | |
# from here: https://dumps.wikimedia.org/other/pagecounts-ez/merged/2012/2012-12/ | |
# I get bz file, unzip to get this: | |
my_file <- 'pagecounts-2012-12-14/pagecounts-2012-12-14' |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# libraries used. install as necessary | |
library(shiny) | |
library(RJSONIO) # acquiring and parsing data | |
library(ggplot2) # graphs | |
library(plyr) # manipulating data | |
library(lubridate) #dates | |
library(stringr) | |
trim.leading <- function (x) sub("^\\s+", "", x) |
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
# File # 1 | |
# https://drive.google.com/open?id=1Lhz23JP4gRW4p_01D7OzaL60CT1wfem- | |
# File # 2 | |
# https://drive.google.com/open?id=1XOWD8COTdDx30HNLZgrp57WzWUGOtaKA | |
# NOTE: To load data, you must download both the extract's data and the DDI | |
# and also set the working directory to the folder with these files (or change the path below). | |
#install.packages("tidyverse") |
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(data.table) | |
library(dplyr) | |
library(R.utils) | |
# JUST MASS | |
mass <- gunzip("arcos-ma-statewide-itemized.tsv.gz") | |
mass_opioids <- fread(file = 'arcos-ma-statewide-itemized.tsv') | |
glimpse(mass_opioids) # 2,574,240 observations | |
summary(mass_opioids) |
OlderNewer