search for: x_cs

Displaying 1 result from an estimated 1 matches for "x_cs".

Did you mean: _cs
2013 Apr 25
1
Looping through names of both dataframes and column-names
...for (df in nls) { print(df) for (var in names(get(df))) { print(var) assign(paste0(df,"$",paste0(var,"_cs")),cumsum(get(df)[[var]])) }} ls()[grep("df_",ls())] The code above *almost* works, except that it creates a whole bunch of objects of the form df_1$x_cs,df_1$yx_cs ..... What I want is 5 dataframes, with the $ elements enclosed, as usual. Any help or guidance would be appreciated. Much thanks, Dan [[alternative HTML version deleted]]