Ich habe lange Skripts verwendet, um einen Prozess zu erstellen.Schleifen zum Speichern von Daten in R
xm <- 1
produccion_tx <- data.frame(produccion_mes_mes[xm]) # Creates the table in a df
source("4_WMIN.R") # makes the maths
source("5_WMIN.R") # export an excel file
source("6_WMIN.R") # saves the data
mes_t1 <- mylist
xm <- 2
produccion_tx <- data.frame(produccion_mes_mes[xm]) # Creates the table in a df
source("4_WMIN.R") # makes the maths
source("5_WMIN.R") # export an excel file
source("6_WMIN.R") # saves the data
mes_t2 <- mylist
.... und so weiter.
Ich möchte alle diese Daten in Objekten speichern: mes_t1, mes_t2 und so weiter.
for (xm in 1:37) {
produccion_tx <- data.frame(produccion_mes_mes[xm]) # Creates the table in a df
source("4_WMIN.R")# makes the maths
source("5_WMIN.R")#export an excel file
source("6_WMIN.R")# saves the data
mes_t%s <- mylist #the results are in mylist
}
Wie kann ich die Tabelle in jeder Schleife mit einem Namen speichern wie mes_t1, mes_t2, mes_t3 ... etc?
Sie 'assign' verwenden können. – Masoud