Skip to content

Instantly share code, notes, and snippets.

@PaulC91
PaulC91 / sankey.R
Last active March 4, 2018 10:22
Example of using function to create d3 sankey diagram from multiple categorical variables + one numerical value variable of tidy data frame
library(tidyverse)
library(tidygraph)
library(igraph)
library(networkD3)
# https://www.kaggle.com/unitednations/refugee-data/data
asylum_seekers_raw <- read_csv("asylum_seekers.csv")
# get the top 10 countries of origin by 'Total decisions'
top_orig <- asylum_seekers_raw %>%
@PaulC91
PaulC91 / app.R
Created January 27, 2018 13:10
dynamic data transforms + input options in shiny for Gokhan
library(shinydashboard)
library(dplyr)
ui <- navbarPage("test",
tabPanel("dataBuilder", icon = icon("database"),
fluidRow(
box(width = 3, title = "Data Upload", solidHeader = TRUE, status = "primary",
helpText("Choose CSV File (Max size 10 MB)"),
fileInput("file1", "",
multiple = FALSE,
@PaulC91
PaulC91 / paris_trees.R
Created November 15, 2017 15:09
R script to chart and map Paris tree data
library(tidyverse)
library(lubridate)
library(stringr)
library(hrbrthemes)
library(sf)
library(leaflet)
# R script to chart and map Paris tree data
# data available here https://opendata.paris.fr/explore/dataset/les-arbres/ ----------------