similar to: Matrix transposition

Displaying 20 results from an estimated 700 matches similar to: "Matrix transposition"

2011 Apr 18
2
Avoiding loop
Hi everyone. I'm using matrix product such as : #Generate some data NCols = 5 NRows = 5 A = matrix(runif(NCols*NRows), ncol=NCols) B = matrix(runif(NCols*NRows), ncol=NCols) #First calculation R = A%*%B for(i in 1:100) { R = R%*%B } I would like to know if it was possible to avoid the loop by using something like mapply or anything else. Tx in advance, Phil -- View this message
2011 Feb 07
1
Unusual slowing of R matrix multiplication version 2.12.1 (2010-10-15) vs 2.12.0
R Version 2.12.1 (2010-10-15) vs 2.12.0 has slowed down 8 fold for dual core and 17 fold for dual-core-dual-processor Macs. I have checked this result on 3 different macs using the following R-script: Using Version 2.12.0 on a dual core dual processor Mac: > source("http://www.bio.umass.edu/biology/kunkel/pub/R/CuriousResult.R") matrix multiplication 43.543 1.308 14.788
2006 Apr 04
1
imaging and contouring
Dear R'Helpers and Colleagues, I have looked in the documentation, asked to some colleagues in the lab, but was unable to solve the following difficulty. I am running R on a iMac G5 with OS 10.4. The file below (73 rows x 144 col) shows the values of a climatic index on the globe with a grid of 2,5 ? x 2,5 ? (NA = no value): ? With image() and map() and running the following
2011 Nov 01
3
Greek letter
Hi everyone. I'm trying to use small letter phi in a graph produced in R. However, the small letter phi does not look as it should. In fact, it looks like this: http://r.789695.n4.nabble.com/file/n3963311/Untitled.png instead of what is here http://en.wikipedia.org/wiki/Phi Here's the code I use: expression(phi [1]) Anyone has an idea? With regards, Phil -- View this message
2012 Jul 03
2
Data manipulation with aggregate
Hi everyone. I have these data : myData = data.frame(Name = c('a', 'a', 'b', 'b'), length = c(1,2,3,4), type = c('x','x','y','z')) which gives me: Name length type 1 a 1 x 2 a 2 x 3 b 3 y 4 b 4 z I would group (mean) this DF using 'Name' as grouping factor. However, I have a
2012 Nov 29
2
googleVis plot and knitr/sweave
Dear R users. I'm currently making a report with knitr (RStudio) where I would like to plot a googleVis map. However, the map generated is an HTML file which I don't know how to integrate it in my report. So my question is how to include a map generated with googleVis in a PDF created with knitr/sweave. Regards, Phil -- View this message in context:
2010 Oct 12
6
List or matrix of object
Hi everyone. Is it possible in R to create a matrix or a list (vector) or R object. For instance, I have f1 <- function(x) sqrt(x%*%x); f2 <- function(x) (2x+1); I would like to do something like L <- List(); L[1] = f1; L[2] = f2; So, is there a way to create matrix or vector that can contains R object. With regards, Phil -- View this message in context:
2008 Apr 16
1
transposition problem
Hi use Rs, I have a csv file: "1989-90","1990-91" Barley,23,34 Oats,15,16 Which I want to turn into: year, Barley, Oats 1 "1989-90", 23, 15 2 "1990-91",34,16 Transpose doesn't quite do it, is there a standard way? Cheers, Geoff Russell
2003 Jun 12
9
Programcode and data in the same textfile
I have the following problem. It is not of earthshaking importance, but still I have spent a considerable amount of time thinking about it. PROBLEM: Is there any way I can have a single textfile that contains both a) data b) programcode The program should act on the data, if the textfile is source()'ed into R. BOUNDARY CONDITION: I want the data written in the textfile in exactly
2006 Mar 10
1
what's wrong with my "cov"?
Hi all, Why cov(y, y) only gives one value, and cov(t(y), t(y)) gives 3x3 NA matrix? Here my y is listed below and it is a 3x1 matrix. I am expecting that if I have a random vector y=[y1 y2 y3]', here " ' " denotes a transposition so that y is a column vector, where y1, y2, y3 are independent random variables... then cov(y, y) should be E[ y * y' ] - E[y] * E[y] ',
1999 Oct 13
1
dataframe transposition
Dear R-helpers, I wonder if I could impose upon you for forther assistance, this time with dataframes: hopefully this will be of general interest, as I personally have found them hard to get to grips with. I was trying to transpose rows and cols and move col1 to the names. Then all sorts of things go wrong. Although the end result looks the same, page() shows the structure to be quite
2001 May 30
3
Transformation of dissimilarity or distance matrix
Dear List, is there an elegant (or even not elegant) way how to transform dissimilarity or distance matrix A (or, in general, arbitrary symmetrical matrix) by transposition of rows and columns into a form closest to "block diagonal" matrix B? The matrix A is adjusted the following way A[A<epsilon] <-0 #(epsilon is given "small" number) B: (in its ideal form)
2010 Jul 30
4
transpose of complex matrices in R
Hello everybody When one is working with complex matrices, "transpose" very nearly always means *Hermitian* transpose, that is, A[i,j] <- Conj(A[j,i]). One often writes A^* for the Hermitian transpose. I have only once seen a "real-life" case where transposition does not occur simultaneously with complex conjugation. And I'm not 100% sure that that wasn't a
2009 Mar 02
2
R-code help for filtering with for loop
Dear Sir / Madam, I am new for R coding. Kindly help me out in sorting out the following problem. There are 50 rows with six coloumns(you could see in the attached .txt file). I wish to go for filtering this 50 rows for any one of the six coloumns satisfying the value >= 64. I need to have a final table with rows having >= 64 value in any one of the six coloumns and the rest could be
2011 Dec 07
2
Hist and extra space
Hi everyone. I have an histogram like this one: http://imageshack.us/photo/my-images/442/dfsdfsdj.jpg/ I would like to remove the extra space under the histogram so it "touch" the x axis. Is it possible? Here's my code. hist(X, freq = F, col = 'gray', axes = FALSE) abline(v = cyano_euk_min, col = 'red', lty = 3, lw = 2) abline(v = cyano_euk_max, col =
2012 Feb 03
2
sapply help
Hi every one. I'm learning how to use sapply (and other function of this family). Here's what I'm trying to do. I have a vector of lets say 5 elements. I also have a matrix of nX5. I would like to know how many element by column are inferior to each element of my vector. On this example: v = c(1:5) M = matrix(3,2,5) I would like to have a vector at the end which give me 0 0 0 2 2
2013 Apr 26
1
prcomp( and cmdscale( not equivalent?
Hello, I have a dilemma that I'm hoping the R gurus will be able to help resolve. For background: My data is in the form of a (dis)similarity matrix created from taking the inverse of normalized reaction times. That is, each cell of the matrix represents how long it took to distinguish two stimuli from one another-- a square matrix of 45X45 where the diagonal values are all zero (since this
2003 Oct 16
1
princomp with more coloumns than rows: why not?
As of R 1.7.0, princomp no longer accept matrices with more coloumns than rows. I'm curious: Why was this decision made? I work a lot with data where more coloumns than rows is more of a rule than an exception (for instance spectroscopic data). To me, princomp have two advantages above prcomp: 1) It has a predict method, and 2) it has a biplot method. A biplot method shouldn't be too
2012 Apr 20
1
Quick question about princomp/biplot
Hi everyone. I performing a simple PCA using the princomp function. Then, I use the biplot function to show it. However, the function use line number to represent samples. I would like to know if there's a way to use a dot (point) instead of the line number when using the biplot function. With regards, Phil -- View this message in context:
2012 Apr 12
1
Help with vectorization
Hi every one. I have a exponential function (3 fitting parameters) that I would like to use to produce data (6 series) without having to use a loop. Here wl = seq(300,500,1) k1 = c(1.2e-6, 4.9e-6, 9.6e-6, 2.7e-10, 6.7e-8, 7.44e-6) k2 = c(726, 352, 128, 5232, 1538, 128) k3 = c(-176, -224, -257, 88.7, -111, -256) stations = c('R5d', 'R5a', 'R9', '108',