Displaying 1 result from an estimated 1 matches for "logdepth".
Did you mean:
iodepth
2009 Dec 07
2
How to apply five lines of code to ten dataframes?
Hello R-helpers,
I have 10 dataframes (named data1, data2, ... data10) and I would like to
add 5 new columns to each dataframe using the following code:
data1$LogDepth<-log10(data1[,2]/data1[,4])
data1$LogArea<-log10(data1[,3]/data1[,5])
data1$p<-2*data1[,6]/data1[,7]
data1$Exp<-data1[,2]^(2/data1[,8])
data1$s<-data1[,3]/data1[,9]
...but I would prefer not to repeat this chunk of code 10 times!
I have struggled with setting up a loop to apply the...