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) | |
library(raster) | |
library(rayshader) | |
#on crée une fonction avec X=longitude, Y=latitude, (les deux en coordonnées géographiques), le titre de la vignette, une distance autour du point central, par défaut à 2km, et une échelle de mise en relief (zs). | |
SortLaCarte<-function(X,Y,titre,distanceautourpoint=2000,repartirde,zs=6){ | |
Lieu_4326<-tibble(nom=titre,y=Y,x= X)%>% | |
st_as_sf(coords=c("x","y"),crs=4326)%>% |
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(imager) | |
library(tidyverse) | |
library(usethis) | |
#Source: https://twitter.com/k_koi/status/1538198569689268226/photo/1 | |
#Kensuke Koike | |
SortLesGraphsGrandVersPetit<-function(url_image, nom_image, squares_width=20,keep_1_every=4){ | |
IMAGE <- imager::load.image(url_image) | |
df1 <- as.data.frame(IMAGE,wide="c") %>% mutate(rgb.val=rgb(c.1,c.2,c.3)) | |
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) | |
#import des données spatiales | |
ContoursCommunes<-st_read("https://raw.githubusercontent.com/Valexandre/france-geojson/raw/master/communes.geojson")%>%st_transform(crs2154) | |
arr<-st_read("https://raw.githubusercontent.com/Valexandre/france-geojson/master/arrondissements-millesimes0.geojson")%>%st_transform(crs=2154) | |
DepsMetro<-st_read("https://raw.githubusercontent.com/Valexandre/france-geojson/master/departements.geojson")%>% | |
filter(nchar(code)==2)%>% | |
st_transform(crs=2154) |
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
##%######################################################%## | |
# # | |
#### On veut présenter des valeurs #### | |
#### absolues et des évolutions dans #### | |
#### chaque commune et les mettre #### | |
#### en perspective avec une valeur départementale. #### | |
# # | |
##%######################################################%## | |
#Au Kremlin-Bicêtre, la population VERBE AU PASSE COMPOSE, passant de XXX à YYYY tandis qu'elle VERBE A L'IMPARFAIT dans le reste du Val de Marne, autour de ZZZZ. |
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(readr) | |
library(sf) | |
library(ggmap) | |
library(osmdata) | |
library(ggforce) | |
APIGG<-"XXXXX" | |
register_google(key = APIGG) |
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(imager) | |
library(tidyverse) | |
URL1<-"1280px-CLaude_Monet_037.jpg" | |
IMAGE <- imager::load.image(URL1) | |
df1 <- as.data.frame(IMAGE,wide="c") %>% mutate(rgb.val=rgb(c.1,c.2,c.3)) | |
df1<-df1%>%mutate(xNtile=ntile(x,60), | |
yNtile=ntile(y,60))%>% | |
group_by(xNtile,y)%>% | |
mutate(Xrang=rank(-x), |