Hi all,

I am processing 24 samples data and combine them in single table called
CombinedSamples using following:

CombinedSamples<-rbind(Sample1,Sample2,Sample3)

Now variables Sample1, Sample2 and Sample3 have many different columns.

To make it more flexible for other samples I'm replacing above code with a
for loop:

#Sample is a string vector containing all 24 sample names

for (k in 1:length(Sample))
{
      CombinedSamples<-rbind(get(Sample[k]))
}

This code only stores last sample data as CombinedSample gets overwritten
every time. Using "CombinedSamples[k]" or "CombinedSamples[k,]" causes
dimension related errors as each Sample has several rows and not just 24. So
how can I assign data of all 24 samples to CombinedSamples?

Thanks,

Anand

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to