Try this:

do.call(cbind, lapply(dir(pattern = '.out3$'), read.table))

On Mon, Jul 12, 2010 at 1:08 AM, jd6688 <jdsignature@gmail.com> wrote:

>
> I have 30 files in the current directories, i would like to perform the
> cbind(fil1,file2,file3,file4....file30)
>
> how could i do this in a for loop:
>
> such as:
>     file2 <- list.files(pattern=".out3$")
>       for (j in file2) {
>         cbind(j).......how to implement cbind here
>      }
>
>
> Thanks.
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/cbind-in-for-loops-tp2285690p2285690.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

	[[alternative HTML version deleted]]

