[R] R matrix help

2012-06-14 Thread karthicklakshman
in context: http://r.789695.n4.nabble.com/R-matrix-help-tp4633372.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

Re: [R] R matrix help

2012-06-14 Thread R. Michael Weylandt
Regards karthick -- View this message in context: http://r.789695.n4.nabble.com/R-matrix-help-tp4633372.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

Re: [R] R matrix help

2012-06-14 Thread Sarah Goslee
But the meaning of a 3x4 table is rather different than the meaning of a 1x12 table. Regardless, you probably want to start with integer factorization, and can read more about implementations in R here (and elsewhere): http://tolstoy.newcastle.edu.au/R/help/05/01/10007.html Sarah On Thu, Jun

Re: [R] R matrix help

2012-06-14 Thread John Kane
-help@r-project.org Subject: [R] R matrix help Dear R experts, I am interested in getting the dimensions for the matrix dynamically, based on the the number of elements in a matrix for example. if the number is 12, I should get dim= 3X4, if it is 20, dim=5X4. please help me do

Re: [R] R matrix help

2012-06-14 Thread Kehl Dániel
. if the number is 12, I should get dim= 3X4, if it is 20, dim=5X4. please help me do this. Thank you Regards karthick -- View this message in context: http://r.789695.n4.nabble.com/R-matrix-help-tp4633372.html Sent from the R help mailing list archive at Nabble.com

Re: [R] R matrix help

2012-06-14 Thread David L Carlson
- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of karthicklakshman Sent: Thursday, June 14, 2012 7:51 AM To: r-help@r-project.org Subject: [R] R matrix help Dear R experts, I am interested in getting the dimensions for the matrix dynamically

Re: [R] R matrix help

2012-06-14 Thread Sarah Goslee
Can you explain why n=12 should result in 3x4 instead of 2x6 or 6x2 or 4x3 or 1x12 ? On Thu, Jun 14, 2012 at 8:51 AM, karthicklakshman karthick.laksh...@gmail.com wrote: Dear R experts, I am interested in getting the dimensions for the matrix dynamically, based on the the number of elements

Re: [R] R matrix help

2012-06-14 Thread Jeff Newmiller
, I should get dim= 3X4, if it is 20, dim=5X4. please help me do this. Thank you Regards karthick -- View this message in context: http://r.789695.n4.nabble.com/R-matrix-help-tp4633372.html Sent from the R help mailing list archive at Nabble.com

Re: [R] matrix help (first occurrence of variable in column)

2011-05-19 Thread Michael Denslow
On Wed, May 18, 2011 at 9:49 PM, jim holtman jholt...@gmail.com wrote: Is this what you were after: mdat - matrix(c(1,0,1,1,1,0), nrow = 2, ncol=3, byrow=TRUE, +               dimnames = list(c(T1, T2), +                               c(sp.1, sp.2, sp.3))) mdat   sp.1 sp.2 sp.3 T1    1    

Re: [R] matrix help (first occurrence of variable in column)

2011-05-19 Thread jim holtman
Is this what you are looking for: mdat3 sp.1 sp.2 sp.3 sp.4 sp.5 T110010 T210010 T311100 T410111 # create a matrix of when species first appeared first - apply(mdat3, 2, function(x) (cumsum(x == 1) 0) + 0L) #

[R] matrix help (first occurrence of variable in column)

2011-05-18 Thread Michael Denslow
Dear R help, Apologies for the less than informative subject line. I will do my best to describe my problem. Consider the following matrix: mdat - matrix(c(1,0,1,1,1,0), nrow = 2, ncol=3, byrow=TRUE, dimnames = list(c(T1, T2), c(sp.1, sp.2, sp.3)))

Re: [R] matrix help (first occurrence of variable in column)

2011-05-18 Thread jim holtman
Is this what you were after: mdat - matrix(c(1,0,1,1,1,0), nrow = 2, ncol=3, byrow=TRUE, + dimnames = list(c(T1, T2), + c(sp.1, sp.2, sp.3))) mdat sp.1 sp.2 sp.3 T1101 T2110 # do 'rle' on each column and see if it is

[R] Matrix Help

2011-02-20 Thread Dmitry Berman
Listers, I have a simple matrix: -- m -c(1:7) m - cbind(m) m [1,] 1 [2,] 2 [3,] 3 [4,] 4 [5,] 5 [6,] 6 [7,] 7 --- I want to add a second column using: [[alternative HTML version deleted]]

Re: [R] Matrix Help

2011-02-20 Thread Dmitry Berman
On Sun, Feb 20, 2011 at 5:55 PM, Dmitry Berman ravenb...@gmail.com wrote: Listers, I have a simple matrix: -- m -c(1:7) m - cbind(m) m [1,] 1 [2,] 2 [3,] 3 [4,] 4 [5,] 5 [6,] 6 [7,] 7 --- I want to add a second

Re: [R] Matrix Help

2011-02-20 Thread David Winsemius
On Feb 20, 2011, at 5:56 PM, Dmitry Berman wrote: On Sun, Feb 20, 2011 at 5:55 PM, Dmitry Berman ravenb...@gmail.com wrote: Listers, I have a simple matrix: -- m -c(1:7) m - cbind(m) m [1,] 1 [2,] 2 [3,] 3 [4,] 4 [5,] 5 [6,] 6 [7,] 7

Re: [R] Matrix Help

2011-02-20 Thread Mark Knecht
On Sun, Feb 20, 2011 at 2:56 PM, Dmitry Berman ravenb...@gmail.com wrote: On Sun, Feb 20, 2011 at 5:55 PM, Dmitry Berman ravenb...@gmail.com wrote: Listers, I have a simple matrix: -- m -c(1:7) m - cbind(m) m [1,] 1 [2,] 2 [3,] 3 [4,] 4 [5,] 5 [6,]

[R] matrix help

2010-09-26 Thread purna
Anyone know how write a function that solves: (1 + c)x1 +x2 +x3 = 5 x1+(1 + c)x2+x3 = 5 + 2c x1+x2 +(1 + c)x3= 5 + 3c, where c is a small constant, for 1000 equidistant values c = (10^-14, 2*10^-14,

Re: [R] matrix help

2010-09-26 Thread Remko Duursma
I think you want ?solve ... Remko -- View this message in context: http://r.789695.n4.nabble.com/matrix-help-tp2714378p2714896.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list