I want to find the RMSE between the columns in each dataframe present in the list. I have written below code:
i3<-2:6
for(iter in 1:length(filenames)){ # length(filename)=45
  for (i in seq_along(i3)){
    RMSE<-lapply(filelist, function(x) sqrt(mean(as.numeric(x[[iter]][[7]])-as.numeric(x[[iter]][[i]]))^2))
  }
}
But this code not working fine.
Dataframes is in below format:
df1:
    col2 col3 col4 col5 col6 col7 
    5     4    3     2     3  4     
    4     2    3    4      4  2      
df2:
    col2 col3 col4 col5 col6 col7  
    5     4    3     2     3  4     
    4     2    3    4      4  2   
I want o/p in the below form:
df1:
col2 col3 col4 col5 col6 col7 RMSE(7-2) RMSE(7-3) RMSE(7-4) RMSE(7-5) 
5     4    3     2     3  4     4.5        3.5     4.3        2.4
4     2    3    4      4  2      3.5       2        3.5        2.4
df2:
col2 col3 col4 col5 col6 col7 RMSE(7-2) RMSE(7-3) RMSE(7-4) RMSE(7-5) 
5     4    3     2     3  4     4.5        3.5     4.3        2.4
4     2    3    4      4  2      3.5       2        3.5        2.4
Thanks in advance!!
 
    