[R] Shape manipulation

Christofer Bogaso bogaso.christofer at gmail.com
Sat Mar 3 20:04:31 CET 2012


Thanks David for your reply. And regarding the plain-text sending, I
thought it was enabled in my Outlook. However recently I formatted and
reinstalled everything therefore that option was not corrected which
now I have corrected.

Thanks,

On Sun, Mar 4, 2012 at 12:25 AM, David Winsemius <dwinsemius at comcast.net> wrote:
>
>
> On Mar 3, 2012, at 11:02 AM, Bogaso Christofer wrote:
>
>> Hi all, let say I have following matrix:
>>
>>
>>
>>> Dat <- matrix(1:30, 5, 6); colnames(Dat) <- rep(c("Name1", "Names2"), 3)
>>
>>
>>> Dat
>>
>>
>>    Name1 Names2 Name1 Names2 Name1 Names2
>>
>> [1,]     1      6    11     16    21     26
>>
>> [2,]     2      7    12     17    22     27
>>
>> [3,]     3      8    13     18    23     28
>>
>> [4,]     4      9    14     19    24     29
>>
>> [5,]     5     10    15     20    25     30
>>
>>
>>
>>> From this matrix, I want to create another matrix with 2 columns for "Name1"
>>
>> and "Name2". Therefore, my final matrix will have 2 columns and 15 rows. Is
>> there any direct R function to achieve this?
>>
>
> rbind(Dat[,1:2], Dat[,3:4], Dat[,5:6])
>
>>        [[alternative HTML version deleted]]
>
>
> Bogaso;
>
> It is really long past due for you to learn how to send plain text messages from your mailer.
>
> --
>
> David Winsemius, MD
> West Hartford, CT
>



More information about the R-help mailing list