arduino-photometrics/exec/merge_photo_csv.r
Aurélien Gauthier 4cf327504f r files changes
2026-01-16 11:11:44 +01:00

22 lines
686 B
R

# install.packages("ragg")
# install.packages("tidyverse")
# install.packages("ggplot2")
library(ggplot2)
library(dplyr)
setwd("~/Documents/PlatformIO/Projects/Robot_Go_West/arduino-photometrics/exec")
chemin <- "../data/photo_measures/"
fichiers <- list.files(path = chemin, pattern = "\\.csv$", full.names = TRUE)
liste_data <- lapply(fichiers, read.csv, header = TRUE)
#partial_list_data <- liste_data[3:6]
photo <- do.call(rbind, liste_data)
csv_name <- "merged_photo_data.csv"
csv_path_name <- paste(c(chemin, csv_name), collapse = "")
write.csv2(photo, file = "merged_photo_data", sep = ",", eol = "\n", col.names = TRUE,)
write.csv(photo, csv_path_name, row.names = FALSE)