I hereby claim:
- I am briatte on github.
- I am briatte (https://keybase.io/briatte) on keybase.
- I have a public key whose fingerprint is CF1D 937F 13FD 11F4 9060 57C7 EC0B 0E46 6A4C 4EDE
To claim this, I am signing this object:
library(httr) | |
adresse <- "8 bd du port" | |
resultraw <- httr::GET(utils::URLencode(paste0('https://api-adresse.data.gouv.fr/search/?q=', adresse))) | |
result <-jsonlite::fromJSON(httr::content(resultraw, "text")) | |
result$features |
#!/bin/sh | |
ONLINE='###WEBSITE_ADDRESS###' | |
OFFLINE='###WEBSITE_OFFLINE_ADDRESS###' | |
FTP_ADDRESS='###FTP_ADDRESS###' | |
FTP_FOLDER='###FTP_ROOT_FOLDER###' | |
FTP_USER='###FTP_USERNAME###' | |
FTP_PASS='###FTP_PASSWORD###' | |
cd $OFFLINE |
<?xml version="1.0" encoding="iso-8859-1"?> | |
<opml version="1.0"> | |
<head> | |
<title>Sample OPML file</title> | |
</head> | |
<body> | |
<outline title="Gists: dsparks" text="" type="rss" version="RSS" xmlUrl="https://gist.github.com/dsparks.atom" htmlUrl="https://gist.github.com/dsparks"/> | |
</body> | |
</opml> |
# Original by Kevin Ushey: | |
# https://raw.githubusercontent.com/kevinushey/etc/master/dotfiles/.Rprofile | |
.First <- function() { | |
# only run in interactive mode | |
if (!interactive()) | |
return() | |
# create .Rprofile env |
{ | |
"user": { | |
"id": "1234567890", | |
"screen_name": "example" | |
}, | |
"timeline": [ | |
{ | |
"headline": "Sh*t People Say", | |
"type": "default", | |
"text": "People say stuff", |
I hereby claim:
To claim this, I am signing this object:
library(foreign) ## for data import | |
library(dplyr) ## for chaining ops together | |
library(ggplot2) ## for plotting | |
library(reshape2) ## for reshaping | |
library(hrbrthemes) ## for pretty pictures | |
library(survey) ## for... uh, survey data | |
party.colours <- c("#0087DC","#D50000","#FDBB30","#FFFF00","#008142","#99CC33","#70147A","#DDDDDD") | |
bes <- read.spss("~/Dropbox/2017-forecasting/data/individual/BES2015_W10_Panel_v0.3.sav") |
cap log close | |
log using /Users/fr/Desktop/ess.log, replace | |
use data/ess0810 if cntry == "FR" & ctzcntr == 1, clear | |
fre vote | |
gen voted = (vote == 1) if vote < 3 & !mi(vote) | |
prop voted if essround == 4 [pw = dweight] // 2008 | |
prop voted if essround == 5 [pw = dweight] // 2010 |
01_code.r
– R code to replicate the plots shown in the articlep12_vote_hollande.csv
– Hollande 2012 vote shares; sourcep17_parrainages_18mars2017_14h.csv
– candidate sponsors; sourcesocialistesavecmacron.fr-2017-03-27-17h27.html
– timestamped copy of this Web pagelibrary(readr) | |
library(dplyr) | |
library(ggplot2) | |
# résultats Hollande 2012 | |
p12 <- read_csv("p12_vote_hollande.csv") | |
p12$metropole <- nchar(p12$dept_code) < 3 & p12$dept_code != "99" | |
p12 <- group_by(p12, metropole, dept_name) %>% | |
summarise( | |
pc_fh_t1 = 100 * sum(t1fh) / sum(t1ex), |