Have you tried:

combined[,19] <- paste(combined[,19], combined[,20], sep=' ')

On Wed, May 12, 2010 at 4:40 AM, Assa Yeroslaviz <frymor@gmail.com> wrote:

> Hello,
>
> I'm trying to paste two columns of a matrix
> GB_ACC    GENE    GENE_SYMBOL
> NM_010657    NM_010657
> NM_027162    NM_027162
> NM_198863    NM_198863
> NM_010727    NM_010727
>
> These two column are a part of a 41,000 x 26 matrix.
>
> I wanted these two column to be pasted into one (the firstone, GB_ACC). I
> tried to do it with a for loop, but it takes ages to finish:
> for( i in 1:length(combined[,15])){
>    combined[i,19]<- paste(combined[i,19], combined[i,20], sep = " ")
> }
>
> Does anyone has a better idea?
> I tried to do it with the apply function, but I'm getting an error message
> that paste(...) is not a function.
>
> THX
>
> Assa
>
>        [[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<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?

	[[alternative HTML version deleted]]

