Re: [R] matrix of size 30^5

2013-04-20 Thread David Winsemius
On Apr 20, 2013, at 2:19 PM, Benjamin Caldwell wrote: > Dear R helpers > > Reproducible example: > > #warning - this causes a hard freeze on the machines I've tried it on > matrix.holder<- matrix(rnorm(150), nrow=30, ncol=5) > > Out= > expand.grid(matrix.holder[,1],matrix.holder[,2],matrix.hol

[R] matrix of size 30^5

2013-04-20 Thread Benjamin Caldwell
Dear R helpers Reproducible example: #warning - this causes a hard freeze on the machines I've tried it on matrix.holder<- matrix(rnorm(150), nrow=30, ncol=5) Out= expand.grid(matrix.holder[,1],matrix.holder[,2],matrix.holder[,3],matrix.holder[,4], matrix.holder[,5]) Problem: I'm running an an

Re: [R] Matrix reduction

2013-04-06 Thread Berend Hasselman
On 06-04-2013, at 22:01, Bert Gunter wrote: > ?chol > > ##also > Quite true and therefore: ?backsolve # forwardsolve and ?qr # qr.solve So there's a lot to choose from. Berend > -- Bert > > On Sat, Apr 6, 2013 at 11:12 AM, Berend Hasselman wrote: >> >> On 06-04-2013, at 19:58, An

Re: [R] Matrix reduction

2013-04-06 Thread Bert Gunter
?chol ##also -- Bert On Sat, Apr 6, 2013 at 11:12 AM, Berend Hasselman wrote: > > On 06-04-2013, at 19:58, Angelo Scozzarella Tiscali > wrote: > >> Well, I mean to use the elimination method to transform the matrix, for >> example, of the coefficients of a linear equations system. >> >> AS

Re: [R] Matrix reduction

2013-04-06 Thread Berend Hasselman
On 06-04-2013, at 19:58, Angelo Scozzarella Tiscali wrote: > Well, I mean to use the elimination method to transform the matrix, for > example, of the coefficients of a linear equations system. > > AS > Well if you only need to solve a linear equation system have a look at solve. If you h

Re: [R] Matrix reduction

2013-04-06 Thread Angelo Scozzarella Tiscali
Well, I mean to use the elimination method to transform the matrix, for example, of the coefficients of a linear equations system. AS Il giorno 06/apr/2013, alle ore 19:43, Angelo Scozzarella Tiscali ha scritto: > Hi everyone, > > I asked myself if exists a way to get a rows (or columns) matr

Re: [R] Matrix reduction

2013-04-06 Thread Bert Gunter
Incomprehensible. Define:"matrix reduction" . Perhaps: ?qr ?svd ## and links therein. -- Bert On Sat, Apr 6, 2013 at 10:43 AM, Angelo Scozzarella Tiscali wrote: > Hi everyone, > > I asked myself if exists a way to get a rows (or columns) matrix reduction > with R. > My goal is for education

[R] Matrix reduction

2013-04-06 Thread Angelo Scozzarella Tiscali
Hi everyone, I asked myself if exists a way to get a rows (or columns) matrix reduction with R. My goal is for education. Thanks in advance AS __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] matrix multiplication

2013-02-27 Thread arun
Hi, Try this: #mat1 is the data res<-do.call(cbind,lapply(seq_len(nrow(mat1)),function(i) {new1<-do.call(rbind,lapply(seq_len(nrow(mat1[-i,])),function(j) {x1<-rbind(mat1[i,],mat1[j,]); x2<-(abs(x1[1,1]-x1[2,1])*abs(x1[1,5]-x1[2,5]))+(abs(x1[1,2]-x1[2,2])*abs(x1[1,6]-x1[2,6]))+(abs(x1[1,3]-x1[2

Re: [R] matrix multiplication

2013-02-27 Thread arun
Hi, Just to add: res<-do.call(cbind,lapply(seq_len(nrow(mat1)),function(i) {new1<-do.call(rbind,lapply(seq_len(nrow(mat1[-i,])),function(j) {x1<-rbind(mat1[i,],mat1[j,]); x2<-(abs(x1[1,1]-x1[2,1])*abs(x1[1,5]-x1[2,5]))+(abs(x1[1,2]-x1[2,2])*abs(x1[1,6]-x1[2,6]))+(abs(x1[1,3]-x1[2,3])*abs(x1[1,7

Re: [R] matrix multiplication

2013-02-27 Thread arun
HI Elisa, You can also use: mat2<- head(mat1) resNew<-do.call(cbind,lapply(seq_len(nrow(mat2)),function(i) do.call(rbind,lapply(split(rbind(mat2[i,],mat2[-i,]),1:nrow(rbind(mat2[i,],mat2[-i,]))),function(x) {x1<-rbind(mat2[i,],x); x2<-(abs(x1[1,1]-x1[2,1])*abs(x1[1,5]-x1[2,5]))+(abs(x1[1,2]-x1[

Re: [R] matrix manipulation with its rows

2013-01-16 Thread arun
Wednesday, January 16, 2013 2:59 AM Subject: [R] matrix manipulation with its rows Dear R users, I have a question about matrix manipulation with its rows. Plz see the simple example below sample <- list(matrix(1:6, nr=2,nc=3), matrix(7:12, nr=2,nc=3), matrix(13:18,nr=2,nc=3)) > sample [[1]

Re: [R] matrix manipulation with its rows

2013-01-16 Thread Patrick Burns
Not a great solution, I don't think, but: > kronecker(diag(2), matrix(1:6, 2, byrow=TRUE))[c(1,4),] [,1] [,2] [,3] [,4] [,5] [,6] [1,]123000 [2,]000456 So using a function that does this in 'lapply' should solve the problem you state. I'm gue

Re: [R] matrix manipulation with its rows

2013-01-16 Thread PIKAL Petr
ect.org] On Behalf Of Kathryn Lord > Sent: Wednesday, January 16, 2013 9:00 AM > To: r-help@r-project.org > Subject: [R] matrix manipulation with its rows > > Dear R users, > > I have a question about matrix manipulation with its rows. > > Plz see the simple example bel

[R] matrix manipulation with its rows

2013-01-16 Thread Kathryn Lord
Dear R users, I have a question about matrix manipulation with its rows. Plz see the simple example below sample <- list(matrix(1:6, nr=2,nc=3), matrix(7:12, nr=2,nc=3), matrix(13:18,nr=2,nc=3)) > sample [[1]] [,1] [,2] [,3] [1,]135 [2,]246 [[2]] [,1] [,2] [,

Re: [R] Matrix multiplication

2012-12-12 Thread Thomas Stewart
One solution that does not require matrix multiplication: Remember that the steady state vector is in the nullspace of I - T. Therefore: require(MASS) n1 <- Null(t(diag(nrow(T)) - T)) n1 / sum(n1) On Wed, Dec 12, 2012 at 2:19 AM, annek wrote: > Hi, > I have a transition matrix T for which I

Re: [R] Matrix multiplication

2012-12-12 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of annek > Sent: Tuesday, December 11, 2012 11:19 PM > To: r-help@r-project.org > Subject: [R] Matrix multiplication > > Hi, > I have a transition matrix

Re: [R] Matrix multiplication

2012-12-12 Thread peter dalgaard
On Dec 12, 2012, at 08:19 , annek wrote: > Hi, > I have a transition matrix T for which I want to find the steady state matrix > for. This could be approximated by taking T^n , for large n. > > T= [ 0.8797 0.0382 0.0527 0.0008 > 0.02120.8002 0.0041 0.0143 > 0.09810

Re: [R] Matrix multiplication

2012-12-12 Thread Fg Nu
, ncol = 4,byrow = T) T %^% 200 - Original Message - From: annek To: r-help@r-project.org Cc: Sent: Wednesday, December 12, 2012 12:49 PM Subject: [R] Matrix multiplication Hi, I have a transition matrix T for which I want to find the steady state matrix for. This could be approximated

[R] Matrix multiplication

2012-12-11 Thread annek
Hi, I have a transition matrix T for which I want to find the steady state matrix for. This could be approximated by taking T^n , for large n. T= [ 0.8797 0.0382 0.0527 0.0008 0.02120.8002 0.0041 0.0143 0.09810.0273 0.8802 0.0527 0.00100.1343 0.0630

Re: [R] Matrix package will not loead

2012-12-06 Thread Uzuner, Tolga I
Many thanks ! Tolga -Original Message- From: Martin Maechler [mailto:maech...@stat.math.ethz.ch] Sent: 06 December 2012 17:19 To: Uzuner, Tolga I Cc: r-help@r-project.org Subject: Re: [R] Matrix package will not loead >>>>> Uzuner, Tolga >>>>> on

Re: [R] Matrix package will not loead

2012-12-06 Thread Martin Maechler
; -Original Message- > From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] > Sent: 13 November 2012 14:08 > To: Uzuner, Tolga I > Cc: Prof Brian Ripley; r-help@r-project.org > Subject: Re: [R] Matrix package will not loead > On 13/11/2012 8:28 AM,

Re: [R] Matrix package will not loead

2012-12-06 Thread Uzuner, Tolga I
environment), but could it be that I am missing something ? Thanks in advance, Tolga -Original Message- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: 13 November 2012 14:08 To: Uzuner, Tolga I Cc: Prof Brian Ripley; r-help@r-project.org Subject: Re: [R] Matrix package

Re: [R] .Rd vs. .R, matrix multiplication

2012-12-03 Thread Duncan Murdoch
On 12-12-03 5:00 PM, Christian Hoffmann wrote: Hi, I find it cumbersomesome the I have to use \%*\% in .Rd files vs. %*% in .R files. R CMD check will refuse %*% in .Rd files. I would like to have %*% in .Rd files to be able to execute expressions with matrix multiplication from .Rd files direct

[R] .Rd vs. .R, matrix multiplication

2012-12-03 Thread Christian Hoffmann
Hi, I find it cumbersomesome the I have to use \%*\% in .Rd files vs. %*% in .R files. R CMD check will refuse %*% in .Rd files. I would like to have %*% in .Rd files to be able to execute expressions with matrix multiplication from .Rd files directly, but ESS (version 5.13) would refuse to e

Re: [R] Matrix to data frame conversion

2012-11-14 Thread MacQueen, Don
So, if you have duplicate row.names, get rid of them. Try rownames(comb_model0) <- NULL as.data.frame(comb_model0) -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 11/12/12 7:45 AM, "PavloEs" wrote: >I have a matri

Re: [R] Matrix in R

2012-11-13 Thread Haszun
It's a bit complicated. Is there any shorter way? Is there possibility to read datas from .csv as matrix, like this which i want to have? -- View this message in context: http://r.789695.n4.nabble.com/Matrix-in-R-tp4649426p4649429.html Sent from the R help mailing list archive at Nabble.com. _

[R] Matrix in R

2012-11-13 Thread Haszun
Is there posiibility to read.table change in matrix? When i used read.table it gave me: V1 V2 V3 V4 [1,] "OsobaA" "10,00" "9,00" "8,00" [2,] "OsobaB" "2,00" "3,00" "1,00" [3,] "OsobaC" "5,00" "6,00" "4,00" I want to change it in: [1,] [2,] [3,] [4,

Re: [R] Matrix package will not loead

2012-11-13 Thread Prof Brian Ripley
Not Found' Warning in download.packages(pkgs, destdir = tmpd, available = available, : -Original Message- From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sent: 13 November 2012 13:03 To: Duncan Murdoch Cc: Uzuner, Tolga I; r-help@r-project.org Subject: Re: [R] Matrix packag

Re: [R] Matrix package will not loead

2012-11-13 Thread Duncan Murdoch
ile(url, destfile, method, mode = "wb", ...) : cannot open: HTTP status was '404 Not Found' Warning in download.packages(pkgs, destdir = tmpd, available = available, : -Original Message- From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sent: 13 November 2012 1

Re: [R] Matrix package will not loead

2012-11-13 Thread Uzuner, Tolga I
rial.ac.uk/src/contrib/Matrix_1.0-9.tar.gz' In addition: Warning message: In download.file(url, destfile, method, mode = "wb", ...) : cannot open: HTTP status was '404 Not Found' Warning in download.packages(pkgs, destdir = tmpd, available = available, : -Origin

Re: [R] Matrix package will not loead

2012-11-13 Thread Prof Brian Ripley
You will find the problem and solution in the list archives. The current version of Matrix can be installed *from source* on R (>= 2.15.0), as it claims. But if you install it on R >= 2.15.2 then it uses features of 2.15.2 and hence can only be run on R >= 2.15.2. And there was a warning abou

Re: [R] Matrix package will not loead

2012-11-13 Thread Duncan Murdoch
On 12-11-13 7:06 AM, Uzuner, Tolga I wrote: Dear Fellow R Users, I am having a problem with the Matrix package, in Windows XP on R 2.15.1 . This is the only package where I experience this. I remove the package first, re install, and then when trying to load, get a LoadLibrary failure as belo

[R] Matrix package will not loead

2012-11-13 Thread Uzuner, Tolga I
Dear Fellow R Users, I am having a problem with the Matrix package, in Windows XP on R 2.15.1 . This is the only package where I experience this. I remove the package first, re install, and then when trying to load, get a LoadLibrary failure as below. Thanks in advance for any assistance. Reg

Re: [R] Matrix to data frame conversion

2012-11-12 Thread David L Carlson
avloEs > Sent: Monday, November 12, 2012 1:09 PM > To: r-help@r-project.org > Subject: Re: [R] Matrix to data frame conversion > > May be I have not clearly explained my problem. Le me try it again. My > problem was with the matrix "comb_model0" . I have tried to conve

Re: [R] Matrix to data frame conversion

2012-11-12 Thread PavloEs
May be I have not clearly explained my problem. Le me try it again. My problem was with the matrix "comb_model0" . I have tried to convert it to a data frame (xx), but could not succeed . As a result I have exported it to a test.csv file and re-imported it. Data frame test is the product of th

Re: [R] Matrix to data frame conversion

2012-11-12 Thread arun
way will be to use ?rbind() comb_model4<-rbind(as.data.frame(mat4),as.data.frame(mat3)) # no need colnames(comb_model4)[4]<-"Pr(>|t|)" A.K. - Original Message - From: PavloEs To: r-help@r-project.org Cc: Sent: Monday, November 12, 2012 10:45 AM Subject: [R] M

Re: [R] Matrix to data frame conversion

2012-11-12 Thread Rui Barradas
Hello, I'm unable to reproduce your error, removing the space in "Std. Error" and changing "t value" to "t.value" the following read in as data.frame with no problems. x <- read.table(text=" Estimate Std.Error t.value Pr(>|t|) (Intercept)

[R] Matrix to data frame conversion

2012-11-12 Thread PavloEs
I have a matrix which I wanted to convert to a data frame. As I could not succeed and resorted to export to csv and reimport it again. Why did I fail in the attempt and how can I achieve what I wanted without this roundabouts? The original matrix: > str(comb_model0) num [1:90, 1:4] 3.5938 0.0

Re: [R] matrix of all difference between rows values

2012-11-11 Thread arun
ec1,"-")),matrix(apply(expand.grid(vec1,vec1),1,diff),ncol=7)) #[1] TRUE A.K. - Original Message - From: cleberchaves To: r-help@r-project.org Cc: Sent: Sunday, November 11, 2012 7:07 AM Subject: Re: [R] matrix of all difference between rows values Hi Arun, i don't

Re: [R] matrix of all difference between rows values

2012-11-11 Thread cleberchaves
Hi Arun, i don't know exactly the error of yours script. Maybe when i changed from "10-x" to "dat1[1,2]-x" (because my real matrix does not start with 10) the error has appeared, the same numbers repeat in all columns. Maybe when i change for your second script that error does not appear again. Ne

Re: [R] matrix of all difference between rows values

2012-11-10 Thread arun
t1)<-dimnames(res1)  mat1 #  a  b  c  d  e #a 0 -1 -2 -3 -4 #b 1  0 -1 -2 -3 #c 2  1  0 -1 -2 #d 3  2  1  0 -1 #e 4  3  2  1  0 A.K. - Original Message - From: cleberchaves To: r-help@r-project.org Cc: Sent: Saturday, November 10, 2012 3:55 PM Subject: Re: [R] matrix of all differe

Re: [R] matrix of all difference between rows values

2012-11-10 Thread arun
r-help@r-project.org Cc: Sent: Saturday, November 10, 2012 2:25 PM Subject: Re: [R] matrix of all difference between rows values Thank you very much, arun kirshna! That's it! I only modified the "res1<-apply(toeplitz(dat1[,2]),1,function(x) 10-x)" for "res1<-apply(toepli

Re: [R] matrix of all difference between rows values

2012-11-10 Thread cleberchaves
Mmmm... Actually, Rui Barradas is the right! Arun kirshna, yours script has an error. That repeat the same set of numbers in all columns... Anyway, thanks for both! -- View this message in context: http://r.789695.n4.nabble.com/matrix-of-all-difference-between-rows-values-tp4649191p4649207.h

Re: [R] matrix of all difference between rows values

2012-11-10 Thread Rui Barradas
Hello, Try the following. # Create the dataset Table1 <- matrix(10:6, ncol = 1) rownames(Table1) <- letters[1:5] Table1 t(outer(Table1[,1], Table1[,1], `-`)) Hope this helps, Rui Barradas Em 10-11-2012 18:32, cleberchaves escreveu: Hello all, i would like to calculate the difference of all r

Re: [R] matrix of all difference between rows values

2012-11-10 Thread cleberchaves
Thank you very much, arun kirshna! That's it! I only modified the "res1<-apply(toeplitz(dat1[,2]),1,function(x) 10-x)" for "res1<-apply(toeplitz(dat1[,2]),1,function(x) dat1[1,2]-x)" and worked very well! Thanks again! -- View this message in context: http://r.789695.n4.nabble.com/matrix-of-a

[R] matrix of all difference between rows values

2012-11-10 Thread cleberchaves
Hello all, i would like to calculate the difference of all row values and the others row values from my matrix (table 1). The output (table 2) would be a matrix with input matrix's row names on row names and colums names, thereby the difference values among two of the row names could be bether foun

Re: [R] matrix algebra for constructing a special matrix?

2012-10-26 Thread William Dunlap
l Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Camarda, Carlo Giovanni > Sent: Friday, October 26, 2012 8:13 AM > To: r-h...@stat.math.ethz.ch > Subject:

[R] matrix algebra for constructing a special matrix?

2012-10-26 Thread Camarda, Carlo Giovanni
Dear R-users, would it be a better way to construct the matrix below without using any for-loop or model.matrix? preferably with some matrix algebra? Thanks in advance, Carlo Giovanni Camarda ## dimensions m <- 3 n <- 4 mn <- m*n k <- m+n-1 ## with a for-loop X <- matrix(0, mn, k) for(i in 1:

Re: [R] Matrix to data.frame with factors

2012-10-19 Thread arun
2 1 1 2 1 2 1 1 1 # $ X5: Factor w/ 2 levels "0","1": 1 1 2 2 2 2 1 1 2 2 A.K. - Original Message - From: brunosm To: r-help@r-project.org Cc: Sent: Friday, October 19, 2012 10:15 AM Subject: Re: [R] Matrix to data.frame with factors Thanks a lot! -- View th

Re: [R] Matrix to data.frame with factors

2012-10-19 Thread brunosm
Obrigado Rui, é isso mesmo ;) -- View this message in context: http://r.789695.n4.nabble.com/Matrix-to-data-frame-with-factors-tp4646730p4646757.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https:

Re: [R] Matrix to data.frame with factors

2012-10-19 Thread brunosm
Thanks a lot! -- View this message in context: http://r.789695.n4.nabble.com/Matrix-to-data-frame-with-factors-tp4646730p4646756.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/m

Re: [R] Matrix to data.frame with factors

2012-10-19 Thread peter dalgaard
On Oct 19, 2012, at 16:07 , Rui Barradas wrote: > Hello, > > Try the following. > > x <- matrix(sample(0:1, 12, TRUE), ncol = 4) > y <- data.frame(apply(x, 2, factor)) > str(y) > > Hope this helps, Another way, possibly more easily generalized: x <- matrix(sample(0:1, 12, TRUE), ncol = 4) y

Re: [R] Matrix to data.frame with factors

2012-10-19 Thread Bert Gunter
Well, strictly speaking, this is still doing it "one variable at a time." The interpreted loop is hidden, but it's still happening. A loop free but clumsier approach is: y <- data.frame(matrix(as.character(x),nrow = nrow(x))) ## Note also that the original column names will be lost and will have

Re: [R] Matrix to data.frame with factors

2012-10-19 Thread Rui Barradas
Hello, Try the following. x <- matrix(sample(0:1, 12, TRUE), ncol = 4) y <- data.frame(apply(x, 2, factor)) str(y) Hope this helps, Rui Barradas Em 19-10-2012 12:04, brunosm escreveu: Hi all, I have a matrix with 100 variables: each variable as a value of 0 or 1. What i want to do is conver

[R] Matrix to data.frame with factors

2012-10-19 Thread brunosm
Hi all, I have a matrix with 100 variables: each variable as a value of 0 or 1. What i want to do is convert this matrix to a data.frame but convert all the variables to factors (0 and 1) also. I know i can do this one variable a time but i have 100 variables... Any easy way of doing this?? Th

[R] Matrix multiplication using Matrix package

2012-06-27 Thread Doran, Harold
I have the following matrix operation A %*% B %*% A Where these matrices have the following dimensions and class attributes. > dim(A) [1] 5764 5764 > class(A) [1] "dgCMatrix" attr(,"package") [1] "Matrix" > dim(B) [1] 5764 5764 > class(B) [1] "dgCMatrix" attr(,"package") [1] "Matrix" Now, wh

Re: [R] matrix manipulation

2012-06-14 Thread Petr Savicky
On Thu, Jun 14, 2012 at 02:24:20PM -0400, cowboy wrote: > thank you, Petr. > This is exactly what I'm looking for in my post. > An related question can be how to get an arbitrary weight, say if row1 > and row 2 have 1 common value 1, then assign a weight 10, if row 1 and > row 2 have 2 common value

Re: [R] matrix manipulation

2012-06-14 Thread cowboy
thank you, Petr. This is exactly what I'm looking for in my post. An related question can be how to get an arbitrary weight, say if row1 and row 2 have 1 common value 1, then assign a weight 10, if row 1 and row 2 have 2 common value 1, then assign a weight 12. I'm not so sure how to expand your me

Re: [R] matrix manipulation

2012-06-14 Thread Petr Savicky
On Thu, Jun 14, 2012 at 01:11:45PM +, G. Dai wrote: > Dear Rlisters, > I'm writing to ask how to manipulate a matrix or dataframe in a specific way. > > To elaborate, let's consider an example. Assume we have the following > 3 by 4 matrix A with elements either 0 or 1, > 0 1 1 0 > 1 0 1

Re: [R] R matrix help

2012-06-14 Thread Jeff Newmiller
X4, 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 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 wrote: > 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.

Re: [R] R matrix help

2012-06-14 Thread David L Carlson
Message- > 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 get

Re: [R] R matrix help

2012-06-14 Thread Kehl Dániel
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 John Kane
PDT) > 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, > based > on the the number of elements in a matrix for example. if the number is > 12, > I should get dim= 3X4,

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 14,

Re: [R] R matrix help

2012-06-14 Thread R. Michael Weylandt
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. > > __ > R-help@r-project.org maili

[R] matrix manipulation

2012-06-14 Thread G. Dai
Dear Rlisters, I'm writing to ask how to manipulate a matrix or dataframe in a specific way. To elaborate, let's consider an example. Assume we have the following 3 by 4 matrix A with elements either 0 or 1, 0 1 1 0 1 0 1 1 0 0 0 1 >From the original matrix A, I'd like to generate a new

[R] R matrix help

2012-06-14 Thread karthicklakshman
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

[R] Matrix package loading problem "Error : object ‘kronecker’ is not exported by 'namespace:methods'"

2012-06-08 Thread RobMusk
Hi R users all , I have a clean install of R-2.15.0 in a win32 machine and a problem loading Matrix 1.0-6 that looks like this: > library(Matrix) Loading required package: lattice Error : object ‘kronecker’ is not exported by 'namespace:methods' Error: package/namespace load failed for ‘Matrix’ >

Re: [R] Matrix Header Name Select

2012-05-29 Thread Rantony
ITS OK. And thanks. Its working ! From: Özgür Asar [via R] [mailto:ml-node+s789695n4631684...@n4.nabble.com] Sent: Tuesday, May 29, 2012 6:04 PM To: Akkara, Antony (GE Energy, Non-GE) Subject: Re: Matrix Header Name Select Sorry, I misunderstood your question. colnames(mymatrix) woul

[R] Matrix Header Name Select

2012-05-29 Thread Rantony
Hi, i have a matrix with headers. How can i get header name in that marix ? i tried in R, with names(MyMatrix[1]) - its getting exactly. But when i try in eclips, its not receiving ColHdr <- names(MyMatrix[1]) - it getting NULL value - could you please help me ? - Thanks Antony. -- View this

Re: [R] Matrix Header Name Select

2012-05-29 Thread Özgür Asar
Sorry, I misunderstood your question. colnames(mymatrix) would select column names of your matrix. Best ozgur - Ozgur ASAR Research Assistant Middle East Technical University Department of Statistics 06531, Ankara Turkey Ph: 90-312-2105309 http://www.s

Re: [R] Matrix Header Name Select

2012-05-29 Thread Özgür Asar
Hi, You can try: colnames(mymatrix)<-NULL Best Ozgur - Ozgur ASAR Research Assistant Middle East Technical University Department of Statistics 06531, Ankara Turkey Ph: 90-312-2105309 http://www.stat.metu.edu.tr/people/assistants/ozgur/ -- View this mess

Re: [R] Renaming names in R matrix

2012-05-15 Thread Paolo Agnolucci
Hello, > A = matrix(0, 3,3) > rownames(A) = c("A", "B", "C") > A [,1] [,2] [,3] A000 B000 C000 HTH, Thanks, Paolo On 15 May 2012 10:19, Gundala Viswanath wrote: > I have the following matrix: > > dat > > [,1] [,2] [,3]

Re: [R] Renaming names in R matrix

2012-05-15 Thread Jessica Streicher
example: > x<-c(1,1,1) > y<-c(2,2,2) > m<-rbind(x,y) > m [,1] [,2] [,3] x111 y222 > dimnames(m) [[1]] [1] "x" "y" [[2]] NULL > dimnames(m)[[1]]<-c("a","b") > m [,1] [,2] [,3] a111 b222 Am 15.05.2012 um 11:19 schrieb Gundala Viswanath: > I ha

[R] Renaming names in R matrix

2012-05-15 Thread Gundala Viswanath
I have the following matrix: > dat [,1] [,2] [,3][,4] foo 0.7574657 0.2104075 0.02922241 0.002705617 foo 0.000 0.000 0. 0.0 foo 0.000 0.000 0. 0.0 foo 0.000 0.000 0. 0.0 foo 0.000 0

Re: [R] Matrix invert

2012-05-11 Thread R. Michael Weylandt
a[NROW(a):1, ] Michael On May 11, 2012, at 3:00 PM, Trying To learn again wrote: > I all, > > I have a matrix like this > > a= > > 1 4 > 2 7 > 3 6 > > > I want to create a new matrix > > b= > > 3 6 > 2 7 > 1 4 > > Anyone knows if there is a "reverse" function? > I can do it with loop

[R] Matrix invert

2012-05-11 Thread Trying To learn again
I all, I have a matrix like this a= 1 4 2 7 3 6 I want to create a new matrix b= 3 6 2 7 1 4 Anyone knows if there is a "reverse" function? I can do it with loops if no exits. [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] Matrix heatmap

2012-05-10 Thread Petr PIKAL
Hi > > how do I plot only the data below 10? everything is white for the 0-10 and > 10-90 is black .. What data below 10? I do not see any. You posted some mails before but I do not keep all mails from R. Only those which helped me somehow. Basically x <- sample(1:100, 100, raplace=TRUE) x[x

Re: [R] Matrix heatmap

2012-05-10 Thread fjucks
how do I plot only the data below 10? everything is white for the 0-10 and 10-90 is black .. those functions which do this? was bad for such basic questions, but I started tinkering with R is 6 days -- View this message in context: http://r.789695.n4.nabble.com/Matrix-heatmap-tp4619084p4625021.ht

Re: [R] Matrix heatmap

2012-05-10 Thread Petr PIKAL
Hi what is wrong with heatmap(as.matrix(test), col=my.colors(25)) with test from your dput Regards Petr > The heat map generated the correct result: > > library(gplots) > arq <-read.table("l") > matrix_l <-data.matrix(arq) > my.colors <- > colorRampPalette(c > ("gray0","gray10","gray20","gr

Re: [R] Matrix heatmap

2012-05-09 Thread fjucks
as was follows: library(gplots) arq <-read.table("r") matrix_l <-data.matrix(arq) pdf("heatmap.pdf", height = 10 , width=10) #paleta de 10 cores - sentido branco -> preto my.colors <- colorRampPalette(c("gray100","gray90","gray80","gray70","gray60","gray50","gray40","gray30","gray20","gray10")) h

Re: [R] Matrix heatmap

2012-05-09 Thread fjucks
last doubts, how do I remove these trace that sits on top of colors? -- View this message in context: http://r.789695.n4.nabble.com/Matrix-heatmap-tp4619084p4621466.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org m

Re: [R] Matrix heatmap

2012-05-09 Thread fjucks
I think it worked here, the data of 25 families are wrong, I'll pack up and post already! earned -- View this message in context: http://r.789695.n4.nabble.com/Matrix-heatmap-tp4619084p4621364.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Matrix heatmap

2012-05-09 Thread fjucks
http://r.789695.n4.nabble.com/file/n4621356/Captura_de_tela-13.png The heat map generated the correct result: library(gplots) arq <-read.table("l") matrix_l <-data.matrix(arq) my.colors <- colorRampPalette(c("gray0","gray10","gray20","gray30","gray40","gray50","gray60","gray80","gray90","gray100

Re: [R] Matrix heatmap

2012-05-09 Thread fjucks
I just do not understand what these parameters that must pass the heat map -- View this message in context: http://r.789695.n4.nabble.com/Matrix-heatmap-tp4619084p4620958.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project

Re: [R] Matrix heatmap

2012-05-09 Thread BrittD
I would leave my table as a heatmap where darker colors represent higher similarity, and the lighter colors represent less level of similarity. I'm using version 2.11 of R. I once used this code, maybe it will help you: #dendogram plot(dendro15, labels = cellType) ### I first made a dendrogra

Re: [R] Matrix heatmap

2012-05-09 Thread Petr PIKAL
Hi > > >arq <-read.table("file") > > arq_matrix <-data.matrix(arq) Are you sure that arg_matrix is numeric? Did you check it somehow? > >dput(arq) You forgot to include dput(arg) result. Without that only you know what arg is. > > arq_heatmap <- heatmap(arq_matrix, Rowv = NA, Colv = NA,col

Re: [R] Matrix heatmap

2012-05-09 Thread fjucks
>arq <-read.table("file") > arq_matrix <-data.matrix(arq) >dput(arq) > arq_heatmap <- heatmap(arq_matrix, Rowv = NA, Colv = NA,col = heat.colors > (256), scale = "column", margins =c(5,10)) dput done with this command, but still gave the same .. I do it before generating the heatmap? would be

Re: [R] Matrix heatmap

2012-05-09 Thread fjucks
this would be the same, like, I need color higher for larger numbers, type, variations of 5 om 5, for example, 0 is white, a little darker 1-5, 6-10 darker still, and so on ... -- View this message in context: http://r.789695.n4.nabble.com/Matrix-heatmap-tp4619084p4619334.html Sent from the R hel

Re: [R] Matrix heatmap

2012-05-08 Thread fjucks
I used only these three command lines in R >arq <-read.table("file") > arq_matrix <-data.matrix(arq) > arq_heatmap <- heatmap(arq_matrix, Rowv = NA, Colv = NA,col = cm.colors > (256), scale = "column", margins =c(5,10)) Excuse me if poorly written, because I'm Brazilian -- View this messa

Re: [R] Matrix heatmap

2012-05-08 Thread Rui Barradas
Hello, Please read the posting guide, like this it's difficult for us to give a sensible an answer. In particular, 1. Use R syntax, your "table" seems to be a "matrix" or "data.frame". Which is it? 2. Post your data using dput(). Just copy it's output and paste it in here, then, we'll beble t

[R] Matrix heatmap

2012-05-08 Thread fjucks
I would like to organize my data as follows: I have a table that contains various data, and the numbers represent a level of similarity between these data, eg RF00013 has 100% similarity with the data RF00014. I would leave my table as a heatmap where darker colors represent higher similarity, a

Re: [R] Matrix "BYTES" size

2012-05-07 Thread jim holtman
If all you want are binary 0/1, then look at the 'bit' package which will let you create a vector of bits. Even for your matrix, you will need almost 1GB of memory to store a copy. On Mon, May 7, 2012 at 5:23 PM, Lucas wrote: > Dear R people. > I惴 facing a big problem. > I need to create a matri

Re: [R] Matrix "BYTES" size

2012-05-07 Thread Mercier Eloi
See ?sparseMatrix from package Matrix. Eloi On 12-05-07 02:23 PM, Lucas wrote: > Dear R people. > I´m facing a big problem. > I need to create a matrix with 10.000 columns and 750.000 rows. > matrix<- as.data.frame(matrix(data=0L, nrow=75, ncol=1) > as you can see, the data frame has huge

[R] Matrix "BYTES" size

2012-05-07 Thread Lucas
Dear R people. I´m facing a big problem. I need to create a matrix with 10.000 columns and 750.000 rows. matrix<- as.data.frame(matrix(data=0L, nrow=75, ncol=1) as you can see, the data frame has huge dimesions. I was able to find out about thr "L" in data, this way I´m telling that my data

Re: [R] Matrix transposition

2012-04-30 Thread Filoche
Thank you sire, this is exactly what I was looking for. Many thanks, Phil -- View this message in context: http://r.789695.n4.nabble.com/Matrix-transposition-tp4599219p4599310.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-p

Re: [R] Matrix transposition

2012-04-30 Thread Rui Barradas
Hello, Filoche wrote > > Hi everyone. > > I want to transpose a data frame. Lets say the following DF: > > df = data.frame(matrix(ncol=4, nrow = 10)) > > df[,1] = c(rep(1,5),rep(2,4), 3) > df[,2] = c(rep('a',4),rep('b',3),rep('c',3)) > df[,3] = c(letters[c(5:13,13)]) > df[,4] = runif(10) > >

[R] Matrix transposition

2012-04-30 Thread Filoche
Hi everyone. I want to transpose a data frame. Lets say the following DF: df = data.frame(matrix(ncol=4, nrow = 10)) df[,1] = c(rep(1,5),rep(2,5)) df[,2] = c(rep('a',4),rep('b',3),rep('c',3)) df[,3] = c(letters[5:14]) df[,4] = runif(10) I would like to form a data frame with each line correspo

<    1   2   3   4   5   6   7   8   9   10   >