[R] Remove carriage return in writing tab-delimited file.

David Winsemius dwinsemius at comcast.net
Thu Apr 5 01:32:23 CEST 2012


On Apr 4, 2012, at 5:58 PM, kickout wrote:

> Having problems with the write.table function. I can write a tab  
> delimited
> file just fine, but for each line in my matrix its inputs a carriage  
> return
> when i dont want it to.
>
> For example my matrix might be:
>
> ID V1 V2 V3
> FARY1004 1 2 3
> FARY2067 2 3 1
> FARY4587 2 2 2
>
> And I want the written File to be:
>
> FARY1004     1     2     3FARY2067     2     3     1FARY4587      
> 2     2
> 2

 > apply(dat,1,cat)
FARY1004 1 2 3FARY2067 2 3 1FARY4587 2 2 2NULL

--

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list