Ajout script R pour filtrer donnees d'entree de l'exo 4

parent f5b40f3e
#!/usr/bin/env Rscript
data = read.table("data/Q_06_latest-2024-2025_RR-T-Vent.csv", sep = ";", header = TRUE)
str(data)
# Keep only columns of interest
data_interest = data[, c("NUM_POSTE", "NOM_USUEL", "AAAAMMJJ", "RR", "TN", "TX", "TM")]
# Keep only data for Nice and for august 2025
filtered_name = data_interest[which(data$NOM_USUEL == "NICE"),]
nrow(filtered_name)
filtered_date = filtered_name[which(filtered_name$AAAAMMJJ > 20250731),]
nrow(filtered_date)
# Export filtered data
write.table(filtered_date, file = "data/Q_06_latest-2024-2025_RR-T-Vent_filtered_Nice_20250801-26.csv", sep = ";", row.names = FALSE, col.names = TRUE)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment