I would like to programm a loop in R to write data frames.
I tried this:
dts <- c('r1', 'r2', 'r3', 'r4', 'r5')
for (dt in dts){
temp <- data.frame(S=paste0(dt,"_RAW$Zeit"), A=paste0(dt,"_RAW$Wert"))
assign(dt, temp)
}
But it did not work. The data frame is not correct (there are no values, only these two lines):
| S | A
-----------------------------
1 | r1_RAW$Zeit | r1_RAW$Wert
I expect this:
r1 <- data.frame(S=r1_RAW$Zeit, A=r1_RAW$Wert)
r2 <- data.frame(S=r2_RAW$Zeit, A=r2_RAW$Wert)
...