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(magrittr) | |
library(magick) | |
image_read("logo:") %>% | |
image_convert('png', colorspace = 'gray') %>% | |
image_edge(radius = 1) %>% | |
image_negate() %>% | |
image_transparent('white', 10000) %>% | |
image_background("white") %>% | |
image_browse() |
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
# You won't need all of these packages. I just copied it from another,related analysis: | |
# https://github.com/svmiller/etjc | |
library(car) | |
library(arm) | |
library(countrycode) | |
library(data.table) | |
library(tidyverse) | |
library(sqldf) | |
# library(pdftools) |
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
#!/bin/bash | |
cd $(echo $0 | sed 's#/[^/]*$##') | |
git pull > /tmp/file.tmp 2>&1 | |
./run.sh >> /tmp/load_portes_etroites.tmp 2>&1 | |
if git status | grep "data/" > /dev/null; then | |
cat /tmp/load_portes_etroites.tmp |
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(dplyr) | |
library(httr) | |
library(readr) | |
library(rvest) | |
d <- read_xml("~/Downloads/digg_reader_subscriptions.xml") %>% | |
xml_nodes("outline") | |
d <- data_frame( | |
title = xml_attr(d, "text"), | |
url = xml_attr(d, "xmlUrl") |
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(MASS) | |
library(rio) | |
library(tidyverse) | |
multhet <- function(y, ## = formula(1~1), | |
v, ## = formula(~1), | |
data) { | |
## check length of inputs | |
if (class(y) != "formula") { |
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
################################################################################ | |
# | |
# ikashnitsky.github.io 2017-07-18 | |
# Accessing Eurostat data using the `eurostat` R package | |
# Young people neither in employment nor in education and training in Europe | |
# Ilya Kashnitsky, ilya.kashnitsky@gmail.com | |
# | |
################################################################################ | |
# Erase all objects in memory |
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(ggplot2) | |
library(readr) | |
d <- read_tsv("data/affiliations.tsv") %>% | |
filter(j != "2015_STRC20IPSA") %>% | |
mutate( | |
y = str_sub(j, 1, 4), | |
e = str_extract(affiliation, "\\((.*?)\\)") %>% | |
str_replace_all("\\(|\\)", "") | |
) %>% |
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
################################################################################ | |
# | |
# ikashnitsky.github.io 2017-06-30 | |
# Produce an RGB coded map of pop structures at NUTS-3 level | |
# Ilya Kashnitsky, ilya.kashnitsky@gmail.com | |
# | |
################################################################################ | |
# Erase all objects in memory | |
rm(list = ls(all = 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(dplyr) | |
# library(igraph) | |
library(readr) | |
library(stringr) | |
library(tidyr) | |
library(networkD3) | |
f <- "parcours_selected.tsv" | |
e <- read_tsv(f, col_types = "ccccccccccccccc") %>% | |
filter(siteId %in% 3, type == "action") %>% |
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) | |
### Make sure to download files from www.parlgov.org! | |
elec <- read.csv("view_election.csv") | |
cab <- read.csv("view_cabinet.csv") | |
party <- read.csv("view_party.csv") | |
### Date | |
cab$start_date <- as.Date(cab$start_date) |