Skip to content

Instantly share code, notes, and snippets.

View GuillaumePressiat's full-sized avatar

GuillaumePressiat

View GitHub Profile
@GuillaumePressiat
GuillaumePressiat / love_verse.R
Created March 24, 2019 10:57
Strength of a Lennon song exposed with R function glue::glue
library(stringfix)
library(magrittr)
one <- c('love', 'is', 'real')
(one %c% ' ') %,% (rev(one) %c% ' ')
love_verse <- function(w1, w2, w3){
glue::glue(
"Love is {b}, {b} is love
@GuillaumePressiat
GuillaumePressiat / xml_to_df.R
Created February 20, 2018 20:07 — forked from nacnudus/xml_to_df.R
Convert xml to a nested data frame
``` r
library(xml2)
library(dplyr)
library(purrr)
library(stringr)
# From the root node:
# If has_children, then recurse.
# Otherwise, attributes, value and children (nested) to data frame.
@GuillaumePressiat
GuillaumePressiat / decoupe_finess_etalab_geocode.py
Last active September 8, 2017 12:57
Découper le fichier Etalab Finess géocodé de data.gouv.fr
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Le fichier est dispo ici : https://www.data.gouv.fr/fr/datasets/finess-extraction-du-fichier-des-etablissements/
import os
os.chdir('..\\..\\')
print ('----------------- Découper Géocodage et structureET Etalab ---------------')