Session introductive
Note
utilitR
, doremifasol
cartiflette
, pynsee
Exemple tiré de l’Insee Analyse sur la mixité sociale
D’autres cours introductifs que je donne peuvent vous intéresser:
Et surtout consultez le portail complet de formation du datalab de l’Insee
Quarto
Observable
Des slides et surtout des TP
guidés ;
Infrastructure informatique (SSPCloud
) fournie par l’Insee pour éviter:
Modalités d’initialisation à venir ;
On va utiliser le SSPCloud
😍🐉☁️🇫🇷 !
(présentation tout à l’heure)
utilitR
👶 ;R
for Data Science (la bible !) ;R
(Sciences Po) ;info_mutations == "Tableau" ? html`<div>${table_mutations1}<div>` : html`<div>${plot_mutations}<div>`
url = "https://files.data.gouv.fr/geo-dvf/latest/csv/2020/communes/92/92049.csv"
proxy = "https://corsproxy.io/?"
dvf = d3.csv(proxy + url)
table_mutations1 = Inputs.table(dvf, {"columns": ['date_mutation', 'valeur_fonciere', 'adresse_nom_voie']})
plot_mutations = Plot.plot({
y: {grid: true, label: "Nombre de transactions"},
x: {
ticks: 12,
transform: (d) => Math.pow(10, d),
type: "log",
tickFormat: "~s",
label: "Prix (échelle log) →"
},
marks: [
Plot.rectY(
dvf.filter(d => d.valeur_fonciere > 10000),
Plot.binX({y: "count"},
{
x: d => Math.log10(d.valeur_fonciere),
tip: true
})
),
Plot.ruleY([0])
]
})
Source: Hadley Wickham, R for data science
info_power_plants == "Tableau" ? html`<div>${table_power_plants}<div>` : html`<div>${plot_power_plants}<div>`
import {us_power_plants, states} from "@observablehq/build-your-first-map-with-observable-plot"
table_power_plants = Inputs.table(
us_power_plants
)
plot_power_plants = Plot.plot({
projection: "albers-usa",
marks: [
Plot.geo(states, { fill: "white", stroke: "#e2e2e2" }),
Plot.dot(us_power_plants, {
x: "longitude",
y: "latitude",
r: "Total_MW",
fill: "PrimSource",
opacity: 0.7,
tip: true
}),
Plot.dot(us_power_plants, { // Can you figure out what this additional Plot.dot layer adds?
x: "longitude",
y: "latitude",
r: "Total_MW",
fill: "PrimSource",
stroke: "black",
filter: d => d.Total_MW > 3500,
}),
Plot.text(us_power_plants, { // Add text to the map using data from us_power_plants
x: "longitude", // Place text horizontally at plant longitude
y: "latitude", // Place text vertically at plant latitude
text: "Plant_Name", // The text that appears is the value from the Plant_Name column,
filter: (d) => d.Total_MW > 3500, // Only add text for plants with capacity exceeding 3500 MW
fontSize: 12, // Increased font size
fontWeight: 600, // Increased font weight
stroke: "white", // Adds white outer stroke to text (for readability)
fill: "black", // Text fill color
textAnchor: "start", // Left align text with the x- and y-coordinates
dx: 15 // Shifts text to the right (starting from left alignment with coordinate)
})
],
r: { range: [1, 15] },
color: { legend: true },
height: 500,
width: 800,
margin: 50
})
Plus d’infos dans mon cours sur les données émergentes
OpenStreetMap
, Wikidata
, OpenFoodFacts
…Python
et R
)cartiflette
data.gouv
Github
: là où on trouve du codeObservable
: the new place to beR
https://www.numerique.gouv.fr/uploads/RAPPORT-besoins-competences-donnee.pdf
Accès facilité à des données spatialisées ;
Acculturation aux SIG et langages statistiques ;
Développement de technologies web interactives (observable
)
We live life in the network. We check our e-mails regularly, make mobile phone calls from almost any location, swipe transit cards to use public transportation,and make purchases with credit cards. Our movements in public places may be captured by video cameras, and our medical records stored as digital files. We may post blog entries accessible to anyone, or maintain friendships through online social networks. Each of these transactions leaves digital traces that can be compiled into comprehensive pictures of both individual and group behavior, with the potential to transform our understanding of our lives, organizations, and societies.
Une des premières cartes statistiques (1798)
John Snow cartographie le choléra à Londres
Everything is related to everything else, but near things are more related than distant things.
W. Tobler, 1970, Economic Geography
R
R
?Note
Python
)On peut tout faire en R
:
Extrait de R for data science (la bible)
R
permet une transparence méthodologique:
R Markdown
rend plus efficace 🐢🔜🐇:
Note
Voir cours dédié sur le sujet des bonnes pratiques (Insee très impliquée sur le sujet!)
CRAN
(The Comprehensive R Archive Network)Github
SSP Cloud
R
) dessusNote
Plus de détails dans la documentation du SSP Cloud
ou dans utilitR
R
, RStudio
et une ribambelle de packages@ens.fr
pour créer un compte sur https://datalab.sspcloud.fr/Vous pouvez adopter le format prenomnom en faisant attention aux règles précédentes. Par exemple, si vous vous appelez Jérôme-Gérard L’Hâltère, votre nom d’utilisateur pourra être jeromegerardlhaltere.
RStudio
Cliquer à gauche sur Catalogue de service
RStudio
Laisser les options par défaut de RStudio
RStudio
Récupérer le mot de passe des services RStudio
RStudio
Autre manière de récupérer le mot de passe des services RStudio
RStudio
S’authentifier sur le service
RStudio
Illustration empruntée à ce livre
Introduction aux méthodes quantitatives avec , École Normale Supérieure (retour page principale)