Supprimer td4_mon_script.R
This commit is contained in:
parent
cadc08f02d
commit
a9d16daff5
|
|
@ -1,51 +0,0 @@
|
|||
# ==============================================================================
|
||||
# TD4 : le prix a la pompe suit-il le prix du petrole ?
|
||||
# ==============================================================================
|
||||
|
||||
|
||||
# Packages ----
|
||||
# Si une ligne library() renvoie une erreur, executez une seule fois la ligne
|
||||
# install.packages() (sans le #), puis relancez les library().
|
||||
# install.packages(c("dplyr", "tidyr", "ggplot2"))
|
||||
library(dplyr)
|
||||
library(tidyr)
|
||||
library(ggplot2)
|
||||
|
||||
|
||||
# Charger les donnees ----
|
||||
# chemin : le dossier td4, qui contient les deux fichiers de donnees.
|
||||
# Gardez UNE des deux lignes (mettez un # devant l'autre) :
|
||||
# - avec un projet ouvert sur votre dossier du cours, le chemin part du projet
|
||||
chemin <- "td4"
|
||||
# - sans projet, le chemin complet du dossier td4, a adapter (des /, pas des \)
|
||||
# chemin <- "W:/Documents/TD_R_2026/td4"
|
||||
|
||||
file.exists(file.path(chemin, "carburants_hebdo.csv")) # doit afficher TRUE
|
||||
hebdo <- read.csv(file.path(chemin, "carburants_hebdo.csv"))
|
||||
petrole <- read.csv(file.path(chemin, "petrole_mensuel.csv"))
|
||||
|
||||
|
||||
# Etape 1 : inspecter (boite a outils : outil 0) ----
|
||||
|
||||
|
||||
|
||||
# Etape 2 : les dates (boite a outils : outil 1) ----
|
||||
|
||||
|
||||
|
||||
# Etape 3 : passer au mois (boite a outils : outil 2) ----
|
||||
|
||||
|
||||
|
||||
# Etape 4 : joindre les deux tables (boite a outils : outil 3) ----
|
||||
|
||||
|
||||
|
||||
# Etape 5, pour la question 2 : decomposer le prix du gazole (boite a outils : outil 4) ----
|
||||
|
||||
|
||||
|
||||
# Votre figure (boite a outils : outils 6 a 8) ----
|
||||
# Facultatif, pour l'enregistrer dans le dossier td4 :
|
||||
# ggsave(file.path(chemin, "td4_question1.png"), figure, width = 8, height = 5, dpi = 150)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user