[R] Matrix manipulation

2007-10-22 Thread yiferic
Hi everyone, suppose I have a 2D matrix, is there a command to snip out a specific row/column and then remerge the remaining columns/rows back into a contiguous matrix? I will need to repeat this operation quite a bit(reverse selection). Thanks for any insights you can offer. Yifei

[R] Matrix manipulation

2009-04-28 Thread Tammy Ma
From: metal_lical...@live.com To: r-help@r-project.org Subject: About Matrix Date: Tue, 28 Apr 2009 11:28:43 +0300 Hi, Dear R users, I have a question: I have A matrix which is 11519X14 and B matrix which is 1764X14, How do I get C matrix which is The remaining matrix after removing

[R] Matrix manipulation

2009-06-11 Thread Payam Minoofar
Hello everyone, I have a couple of fairly simple questions (I hope) the answers to which I cannot find through the documentation at the moment. 1. I would like to delete the a row from a matrix if a certain elimination criterion is met. I am familiar with x <- x[-7,] (to remove row 7, for e

Re: [R] Matrix manipulation

2007-10-22 Thread Tim Calkins
use the '-' feature. >mat <- matrix(rnorm(100), nrow = 10) #snip the second row >mat[-2,] #snip the third column >mat[,-3] #snip rows 5 and 7 >mat[-c(5,7),] cheers tc On 10/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi everyone, > > suppose I have a 2D matrix, is there a command to

Re: [R] Matrix manipulation

2007-10-22 Thread Julian Burgos
Matrices are not made of paper! :) If you index a matrix with negative numbers, you'll get back that matrix minus that column or row. A quick example: >a<-matrix(c(1:9),ncol=3) # Create a sample matrix >a# Display it [,1] [,2] [,3] [1,]147 [2,]2

[R] matrix manipulation problem

2009-09-01 Thread Gregory Gentlemen
Dear fellow R-users, Say we have a matrix x, defined as follows set.seed(50) x <- matrix(rbinom(100*5,1, p=0.75),nrow=100, ncol=5) Now the interpretation of x is that each for of x is actually a sequence of length 5, and i would like to transform x in such a way that I can describe the frequen

Re: [R] Matrix manipulation

2009-06-11 Thread Henrique Dallazuanna
Try this: For the first and the second question: transform(subset(d, row.names(d) != 2), row.names=NULL) On Thu, Jun 11, 2009 at 3:53 PM, Payam Minoofar wrote: > Hello everyone, > > I have a couple of fairly simple questions (I hope) the answers to which I > cannot find through the documentati

Re: [R] Matrix manipulation

2009-06-11 Thread David Winsemius
On Jun 11, 2009, at 2:53 PM, Payam Minoofar wrote: Hello everyone, I have a couple of fairly simple questions (I hope) the answers to which I cannot find through the documentation at the moment. 1. I would like to delete the a row from a matrix if a certain elimination criterion is met

Re: [R] Matrix manipulation

2009-06-11 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius > Sent: Thursday, June 11, 2009 1:49 PM > To: Payam Minoofar > Cc: r-help@r-project.org > Subject: Re: [R] Matrix manipulation > > &g

Re: [R] Matrix manipulation

2009-06-11 Thread Payam Minoofar
On 6/11/09 2:13 PM, "William Dunlap" wrote: > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius > Sent: Thursday, June 11, 2009 1:49 PM > To: Payam Minoofar > Cc: r-help@r-project.org

Re: [R] Matrix manipulation

2009-06-11 Thread Gabor Grothendieck
Or perhaps: M10[rowSums(M10 == 63) == 0, ] On Thu, Jun 11, 2009 at 4:49 PM, David Winsemius wrote: > > On Jun 11, 2009, at 2:53 PM, Payam Minoofar wrote: > >> Hello everyone, >> >> I have a couple of fairly simple questions (I hope) the answers to which I >> cannot find through the documentation

Re: [R] matrix manipulation problem

2009-09-01 Thread Charles C. Berry
On Tue, 1 Sep 2009, Gregory Gentlemen wrote: Dear fellow R-users, Say we have a matrix x, defined as follows set.seed(50) x <- matrix(rbinom(100*5,1, p=0.75),nrow=100, ncol=5) Now the interpretation of x is that each for of x is actually a sequence of length 5, and i would like to transform