similar to: how to flip row/ column of a matrix?

Displaying 20 results from an estimated 30000 matches similar to: "how to flip row/ column of a matrix?"

2010 Apr 23
6
transpose? reshape? flipping? challenge with data frame
Greetings all, I am having difficulty transposing, reshaping, flipping (not sure which) a data frame which is read from a DBF file. I have tried using t(), reshape() and other approaches without success. Can anyone please suggest an way (elegant or not) of flipping this data around ? The initial data is like propsum (defined below), and I want it to look like tpropsum once reformed. >
2005 Jul 07
2
about image() function in R and colors
Hi! I've got a map in R imported from a GIS (GRASS) as a vector of factors. So I've got 20 different levels in the map and I've created a vector of custom colors of exactly 20 colors in lenght. I'm trying to use image() (really plot.grassmeta() that call image()) to plot the map with those colors but it doesnt work and the colors are changed. I would like that all points
2012 Sep 12
1
digit precision in p value of rcorr
Hi all, Sorry about posting a really novice question. I was able to run rcorr after converting the list to a matrix by your help. I'm though wondering if there is any way to find out an exact p value as the output only gave me 0 for P value as shown below. I've added options(digits=10), which doesn't seem to help at all. Any help would be appreciated. P D Prime T
2012 Sep 12
2
How to resolve the following error: (list) object cannot be coerced to type 'double'
Hello, I'd like to test a significance of two variables in their correlation using rcorr, which gave me an error of format incompatibility. Below are the lines that I typed in the R window and let me know if anyone knows how to resolve this. Var=read.csv("03apr10ab_corr_matrix_in_overlaps.csv",header=F) colnames(Var)=c("D Prime","T statistics") D Prime
2003 May 26
4
spinning and flipping arrays
Hello people, Is there some simple way of spinning and/or flipping arrays in R? Here's what I mean. Suppose that foo is a 2x3x4 array with the following contents: (I know this is different than typing 'foo' at and R prompt, but I'm so used to row major order from using APL, I have a hard time with R's output) > foo[1,,] [,1] [,2] [,3] [,4] [1,] 1 2 3 4
2010 Sep 01
2
getting column names of row-by-row sorted matrix
Hi folks, I want to sort a matrix row-by-row and create a new matrix that contains the corresponding colnames of the original matrix. E.g. > set.seed(123) > a <- matrix(rnorm(20), ncol=4); colnames(a) <- c("A","B","C","D") > a A B C D [1,] -0.56047565 1.7150650 1.2240818 1.7869131 [2,]
2017 Oct 10
6
[Bug 103202] New: Tearing with reverse prime (intel primary, nouveau secondary)
https://bugs.freedesktop.org/show_bug.cgi?id=103202 Bug ID: 103202 Summary: Tearing with reverse prime (intel primary, nouveau secondary) Product: xorg Version: 7.7 (2012.06) Hardware: x86-64 (AMD64) OS: Linux (All) Status: NEW Severity: normal Priority: medium
2012 May 03
1
[PATCH] nouveau/dri2: don't try to page flip pixmaps
Port of commit ae45d7e6d8e6844cd4586c9ee97c21b257fa788f in xf86-video-ati. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=49351 (Additionally, don't try to pageflip if user disabled it in xorg.conf. Currently this change is a no-op, because can_exchange returns true only when page flipping is enabled, but commit 169512fbe91f0671a90dfee5e280357f0a4ef701 - which changed can_exchange
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
2006 Apr 21
2
Rotate/edge-flip and jumping mouse pointer
Hi, I'm using running Xgl/compiz on Gentoo/AMD64/2006.0, with xgl-0.0.1_p20060418 and compiz-quinnstorm-0.0.9.3 on Gnome 2.14. I love the edge-flip feature of rotate, but I sometimes have a problem where, after edge-flipping the mouse pointer seems to jump to the opposite window edge which starts rotating the cube to the next desktop, so I start moving the pointer back, whereupon it jumps
2011 Jun 20
3
matrix problem
Hallo everyone! I have a problem about creating a matrix... Suppose we have a vector y<-c(1,1,1,3,2) and a zero matrix, m ,with nrows=length(y) and ncol=4. The matrix would look like this: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 I want to change the first three rows with the vector c(1,2,3,4). I thought that with the command m[y==1,1:4]<-c(1,2,3,4) i would get 1 2 3 4 1 2 3 4 1 2 3 4 0
2009 Dec 24
3
Newbie: colSums() compared with Matlab's sum()
Hi all, I'm trying to learn R after years of Matlab's experience. Here is an issue I couldn't solve today. Consider the following piece of code (written by memory): for(i in 1:n){ submat <- data[1:i,] C <- colSums(submat) } The problem is that at the first iteration, data[1:1,] reduces to a vector and colSums returns an error. This sounds really strange to me
2011 Jun 29
3
4D data acsess
Hi, I have a 4D data file from MATLAB, call it X, that I want to analyze in R. The first 3 dimensions are x y z coordinates and the forth is a value in time. If you took a sample vector in matlab it would look like vec1 = X(x1, y1, z1, :) vec2 = X( x2, y2, z2, :) this would give you all values (I have 300 of them) corresponding to this (x1,y1,z1) point of X. Now I read the MATLAB datafile 4D
2008 Jun 26
2
Data matrix of all possible response patterns
I am looking for a way to generate a data matrix that contains all possible response patterns for 10 binary items. This should produce a matrix with 10 rows (representing 10 items) and 1024 columns (representing 2^10 possible response patterns). Does anyone know of code that would produce such a matrix? Thanks! Sarah Depaoli
2008 Nov 02
2
R CMD check with Matlab and perl?
Hi, All: How might one test Matlab and perl code during "R CMD check"? I ask for two reasons: First, the "fda" package exists in both R and Matlab, and it would help if we could run test examples in Matlab as part of "R CMD check". I tried "R.matlab", but could not get it to work in that context. Second, I have professional
2011 Aug 03
4
Convert matrix to numeric
I have a matrix that looks like this: structure(c("0.0376673981759913", "0.111066500741386", "1", "1103", "18", "OPEN", "DEPR", "0.0404073656092023", "0.115186044704599", "1", "719", "18", "OPEN", "DEPR", "0.0665342096693433",
2006 Sep 27
3
multidimensional lists
In the process of moving a number of my scripts from MATLAB -> R, I've discovered that there is no 'pure' equivalent of MATLAB's cell arrays, which I use quite often. Basically, I create matrices (as a cell array) where each element of the matrix is itself a matrix (e.g., 2x2 cell array where each element of the array is another matrix). I pass these cell arrays to various
2012 Nov 21
6
Scaling values 0-255 -> -1 , 1 - how can this be done?
I have a dataframe in which I have values 0-255, I wish to transpose them such that: if value > 127.5 value = 1 if value < 127.5 value = -1 I did something similar using the "binarize" function of the biclust package, this transforms my dataframe to 0 and 1 values, but I wish to use -1 and 1 and looking for a way in R to do this. Brian
2024 Feb 27
2
converting MATLAB -> R | element-wise operation
Why anything but sweep? The fundamental data type in Matlab is a matrix... they don't have vectors, they have Nx1 matrices and 1xM matrices. Vectors don't have any concept of "row" vs. "column". Straight division is always elementwise with recycling as needed, and matrices are really vectors in row-major order: 1 2 3 4 5 6 is really 1 4 2 5 3 6 and when you do
2015 Jan 30
4
[LLVMdev] RFB: Would like to flip the vector shuffle legality flag
I filed a couple more, in case they're actually different issues: - http://llvm.org/bugs/show_bug.cgi?id=22412 - http://llvm.org/bugs/show_bug.cgi?id=22413 And that's pretty much it for internal changes. I'm fine with flipping the switch; Quentin, are you? Also, just to have an idea, do you (or someone else!) plan to tackle these in the near future? -Ahmed On Thu, Jan 29, 2015 at