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) | |
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/ ---------------- |
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(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, |
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) | |
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 %>% |
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) # dev version of ggplot2 required devtools::install_github('hadley/ggplot2') | |
library(sf) | |
extrafont::loadfonts(device = "win") | |
# election results | |
ge_data <- read_csv("http://researchbriefings.files.parliament.uk/documents/CBP-7979/HoC-GE2017-constituency-results.csv") %>% | |
filter(region_name == "London") %>% | |
select(ons_id, constituency_name, con:green) |
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) | |
library(sf) | |
#https://www.cultureofinsight.com/blog/2018/05/02/2018-04-08-multivariate-dot-density-maps-in-r-with-sf-ggplot2/ | |
svk.dot <- st_read("shp/hranice_obce_3.shp", stringsAsFactors = FALSE, quiet = TRUE) %>% | |
st_transform(4326) | |
colnames(svk.dot)[1] <- "id" |
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(googlesheets) | |
# do this initially to save your token in the app's working direcotory | |
# once it's saved you can comment this code out | |
token <- gs_auth(cache = FALSE) | |
saveRDS(token, file = "googlesheets_shiny_token.rds") | |
# then this code in your app will authenticate and read in a workbook of your choice each time it's loaded | |
gs_auth(token = "googlesheets_shiny_token.rds") | |
sheet_key <- "your_google_sheet_key_here" |
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(discogger) | |
library(tidyverse) | |
library(sf) | |
library(rnaturalearth) | |
library(countrycode) | |
library(scico) | |
my_records <- discogs_user_collection("pacampbell91") | |
my_releases <- map_chr(my_records$content, "id") %>% |
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(rvest) | |
library(tidyverse) | |
library(tidygraph) | |
library(ggraph) | |
wc_squads <- html("https://en.wikipedia.org/wiki/2018_FIFA_World_Cup_squads") | |
tables <- wc_squads %>% | |
html_table() |
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(rvest) | |
library(tidyverse) | |
library(tidygraph) | |
library(ggraph) | |
wc_squads <- read_html("https://en.wikipedia.org/wiki/2018_FIFA_World_Cup_squads") %>% | |
html_table() | |
teams <- c("Egypt", "Russia", "Saudi Arabia", "Uruguay", | |
"Iran", "Morocco", "Portugal", "Spain", |
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) | |
library(officer) | |
library(mschart) | |
# create new ppt with title slide | |
mypres <- read_pptx() %>% | |
add_slide(layout="Title Slide", master="Office Theme") %>% | |
ph_with_text(type = "ctrTitle", str = "Make slide decks with purrr & officer") %>% | |
ph_with_text(type = "subTitle", str = "example using mtcars data") |
OlderNewer