Skip to content

Instantly share code, notes, and snippets.

View SimonCoulombe's full-sized avatar

Simon Coulombe SimonCoulombe

View GitHub Profile
@SimonCoulombe
SimonCoulombe / .gitignore
Last active January 10, 2023 17:49
.gitignore for R
.DS_Store
*.html
core*
*.png
# History files
.Rhistory
.Rapp.history
@SimonCoulombe
SimonCoulombe / shiny_mtcars_list_button_solved.R
Created January 9, 2022 18:15
this works! the list is not a reactive because of the button.
library(shiny)
library(shinyWidgets)
library(dplyr)
mod_filterDataInputMPG_ui <- function(id){
ns <- NS(id)
shinyWidgets::numericRangeInput(
inputId = ns("mpg_range"),
label = "mpg_range",
value = c(0, 99)
)
library(shiny)
library(shinyWidgets)
library(dplyr)
mod_filterDataInputMPG_ui <- function(id){
ns <- NS(id)
shinyWidgets::numericRangeInput(
inputId = ns("mpg_range"),
label = "mpg_range",
value = c(0, 99)
)
library(shiny)
library(shinyWidgets)
library(dplyr)
mod_filterDataInputMPG_ui <- function(id){
ns <- NS(id)
shinyWidgets::numericRangeInput(
inputId = ns("mpg_range"),
label = "mpg_range",
value = c(0, 99)
)
library(shiny)
library(shinyWidgets)
library(dplyr)
mod_filterDataInputMPG_ui <- function(id){
ns <- NS(id)
shinyWidgets::numericRangeInput(
inputId = ns("mpg_range"),
label = "mpg_range",
value = c(0, 99)
)
#https://www.katiejolly.io/blog/2020-03-21/water-lines
library(sf) # spatial data
library(tidyverse) # wrangling/cleaning
library(colorspace) # for lightern()
library(showtext) # google fonts
library(osmdata) # to get shapes
library(polylabelr) # to get pole of inacessibility (point furthest from any edge, to give us an idea of the distance between water lines)
library(purrr) # to add a bunch of buffer lines automatically
font_add_google("Assistant", regular.wt = 300)
library(magrittr)
library(dplyr)
library(sf)
#devtools::install_github("mountainMath/tongfen")
library(tongfen)
library(cancensus)
library(tidygeocoder)
get_utm_crs <- function(longitude){ 32600 + ceiling((longitude - -180)/ 6)} # pour calculer des buffers ronds en mètres comme dans le day 5 de https://gitlab.com/dickoa/30daymapchallenge/-/blob/master/day5/day5-blue.R
library(mapview)
library(sf)
library(tidyverse)
library(pdftools)
library(tabulizer)
library(tesseract)
library(janitor)
library(stringr)
library(cancensus)
library(sf)
library(tidyverse)
library(cancensus)
library(sf)
library(stringr)
library(mapview)
#options(cancensus.api_key = "your_api_key")
#options(cancensus.cache_path = "custom cache path")
list_census_regions('CA16') %>%
filter(level == "CMA", name %in% c("Vancouver","Toronto"))
#https://github.com/sianbladon/Data-Viz/blob/master/30%20Day%20Chart%20Challenge%202021/Day%205%20-%20slope/day_5.R
library(tidyverse)
library(showtext)
font_add_google("Montserrat", "Montserrat")
showtext_auto()
options(theme_bw())
saaq2013 <- read_csv("data/downloads/vehicules-circulation-2013.csv")