I have 2 data frames:
a=c("aaaa","aaaaa", "aaaaaaaa")
b=c(3,5,6)
sample1=data.frame(a,b)
a=c("bb","bbbb","bbbbbbb")
b=c(4,6,54)
sample2=data.frame(a,b)
I want to loop through the samples and pass the columns from these dataframes to some functions e.g. nchar(sample1$b)
So using what should go in the for loop to do this? The code below does not work... sorry it does work but the length of e.g. "sample1$b" string is printed
for(i in 1:2) {
cat(nchar(eval(paste("sample",i,"$b"))))
}
Thanks