I’m trying to do this action in loop:
library(data.table)
dc_clean202211 <- dc_clean202211[, .SD[.N], by="id_call"]
To start I read RDS files like this:
file_list <- list(202211,202210,202209,202208,202207,202206,202205,202204,202203,202202,202201,202112)
for (i in file_list){
#On crée un object par fichier
assign(paste0("dc_clean", i),readRDS(paste0("data/dc_clean", i , ".RDS")))
assign(paste0("dc_clean", i), paste0("dc_clean", i)[, .SD[.N], by="id_call"])
}
But I want to do my request in first row in my loop (or in another).
I tried a lot of possibilities but idk how to do this.