Your list of files are in your my.data
.
files 1:7 are Precipitacion, rbind them together:
Precip <- rbind(my.data)[1:7]
do the same for Radiacion, Temperatura, Velocidad:
Radia <- rbind(my.data)[8:14]
Tempur <- rbind(my.data)[15:21]
Veloc <- rbind(my.data)[22:28]
your files are ordered Date, Precip or Date, Tempur & etc so assuming the
sampling dates are same or similar, make a list of the rbind files using just the columns you need:
clima_objs <- list(Precip[,1], Precip[,2], Radia[,2], Tempur[,2],
Veloc[,2])
then cbind() these together into a data.frame:
clima <- as.data.frame(do.call(cbind, clima_objs))
change names from $V1-$V5
names(clima) <- c("Date", "Precipitacion", "Radiacion",
"Temperatura", "Velocidad")
inspect:
> head(clima)
Date Precipitacion Radiacion Temperatura Velocidad
1 14610 84.284294 84.284294 84.284294 84.284294
2 14641 29.583552 29.583552 29.583552 29.583552
3 14669 105.209802 105.209802 105.209802 105.209802
4 14700 96.281924 96.281924 96.281924 96.281924
5 14730 5.033855 5.033855 5.033855 5.033855
6 14761 94.065157 94.065157 94.065157 94.065157
Ok, cbind changed our date to numeric, so we change it back:
clima$Date <- as.Date.numeric(clima$Date, origin="1970-01-01")
> head(clima)
Date Precipitacion Radiacion Temperatura Velocidad
1 2010-01-01 84.284294 84.284294 84.284294 84.284294
2 2010-02-01 29.583552 29.583552 29.583552 29.583552
3 2010-03-01 105.209802 105.209802 105.209802 105.209802
4 2010-04-01 96.281924 96.281924 96.281924 96.281924
5 2010-05-01 5.033855 5.033855 5.033855 5.033855
6 2010-06-01 94.065157 94.065157 94.065157 94.065157
and now we can ask, what is correlated with what using 'cor`.
>cor(clima$Precipitacion, clima$Temperatura)
[1] 1
which is 1 because I used same data in each column after Date. Now sampling from Tempuratura
>cor(clima$Precipitacion, sample(clima$Temperatura))
[1] 0.04786067