Displaying 20 results from an estimated 1000 matches similar to: "head.matrix() unintelligent"
2011 Sep 06
2
subsetting tables
Hi guys,
one of the questions where you need a real human instead of a search engine,
so it would be great if you could help.
I have a matrix of z-scores which I would like to filter, sometimes
columnwise, sometimes rowwise. Data looks like this:
Allstar hsa.let.7a hsa.let.7a.1 hsa.let.7a.2
2 0.87 0.79 -0.57 1.07
3 0.67 -1.14 -0.78 -0.95
4
2004 Dec 12
2
Help : generating correlation matrix with a particular structure
Hi,
I would like to generate a correlation matrix with a
particular structure. For example, a 3n x 3n matrix :
A_(nxn) aI_(nxn) bI_(nxn)
aI_(nxn) A_(nxn) cI_(nxn)
aI_(nxn) cI_(nxn) A_(nxn)
where
- A_(nxn) is a *specified* symmetric, positive
definite nxn matrix.
- I_(nxn) is an identity matrix of order n
- a, b, c are (any) real numbers
Many attempts have been unsuccessful because a
2010 Oct 08
3
Import Multiple csv files and merge into one Master file
Dear R Group:
How to import multiple csv files and merge into one dataset.
Thanks and Regards,
Xing
[[alternative HTML version deleted]]
2010 Jul 09
3
apply is slower than for loop?
I thought the "apply" functions are faster than for loops, but my most
recent test shows that apply actually takes a significantly longer than a
for loop. Am I missing something?
It doesn't matter much if I do column wise calculations rather than row wise
## Example of how apply is SLOWER than for loop:
#rm(list=ls())
## DEFINE VARIABLES
mu=0.05 ; sigma=0.20 ; dt=.25 ; T=50 ;
2004 Jul 01
1
QR decomposition question
Hi all,
I wonder if this kind of questions are ok in this
list...
Quick question:
What does it mean than the rank of the QR
decomposition of a NxN matrix is N-1 ?
m: NxN matrix
qr(m)$rank equal to (N-1)
Long version:
I'm doing a manova on a matrix of 10 variables
and 16 observations.
> dim(tmp)
[1] 16 10
> fit <- manova( tmp ~ treatment*mouse )
>results <-
2009 Oct 15
2
converting to data.frame
dear allI have a data set with three types (Tree, Sapling, Seedling). I have estimated the correlation values. now i need to bring all the correlation values in a table like the one i have shown in attached file with R codes.could you please give me idea on this problem
thanking you
MSNepal
_________________________________________________________________
Hotmail: Trusted email with
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
2009 Feb 11
4
Efficent way to create an nxn upper triangular matrix of one's
The code below create an nxn upper triangular matrix of one's. I'm
stuck on finding a more efficient vectorized way - Thanks. --Dale
n <- 9
data <- matrix(data=NA, nrow=n, ncol=n)
data
for (i in 1:n) {
data[,i] <- c(rep(1,i), rep(0,n-i))
}
data
2009 Mar 17
2
sweep?
I am having a hard time understanding just what 'sweep' does. The documentation states:
Return an array obtained from an input array by sweeping out a summary statistic.
So what does it mean "weeping out a summary statistic"?
Thank you.
Kevin
2009 Aug 21
4
help with median for each row
Hi,
I tried looking through google search on whether there's a way to computer
the median for each row of a nxn matrix and return the medians for each row
for further computation.
And also if the number of columns in the matrix are even, how could I
specify which median to use?
Thank you very much!
--
Edward Chen
[[alternative HTML version deleted]]
2006 Jul 04
5
removing for loop
Dear Rusers,
Trying to reduce my for loops addiction,
could somebody tell me if there are ways to simplify
(and perhaps accelerate ?) the following line
for (i in 1:N) for (j in 1:N) m[i,j] = b[i]-b[j];
(where m is a NxN matrix and b a vector of length N)
Thanks for any hint.
2002 Mar 21
5
repeating rows or columns within a matrix
Hello
Spse I have a matrix, say
1 2 3
4 5 6
7 8 9
and I would like to expand it by repeating rows within the matrix, to
get, if the repeating factor is 2, say:
123
123
456
456
789
789
(or columnwise as well) . There must be a smart way of doing that?
Many thanks
Juhana Vartiainen
juhana.vartiainen at labour.fi
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
2003 Mar 31
3
monte carlo method for circle area
Hello everyone
I hope Im not bothering you all again. I have just begun to use R and so Im not yet familiarized with it..
I ve got an assignment which consists in calculating the area of a circle given a certain radius and center using the monte carlo method, which means that I have to plot a circle given its parameters. Limit the area inside it...with as many sample points as possible...and
1998 Sep 25
1
format(numericmatrix, ...) : proposal for a change
Since format, i.e., format.default(.), is a pretty basic function I
thought I'd ask before just changing it...
aa <- cbind(1:7, rnorm(7))
format(aa)
or
format(aa, digits=7)
looks like
[,1] [,2]
[1,] " 1.0000000" " 0.2406669"
[2,] " 2.0000000" "-0.4973221"
[3,] " 3.0000000" " 0.4672260"
[4,] "
2009 Dec 17
2
Exchange NAs for mean
Hi all,
I'm have a matrix (X) with observations as rows and parameters as columns. I'm trying to exchange all missing values in a column by the column mean using the code below, but so far, nothing happens with the NAs... Can anyone see where the problem is?
N<-nrow(X) # Calculate number of rows = 108
p<-ncol(X) # Calculate number of columns = 88
# Replace by columnwise
2009 Aug 20
2
Geometric mean of rows in matrix
Is there a function or an easier way to computer geometric means of each
rows in a nxn matrix and spit out in an 1xn matrix ?
--
Edward Chen
[[alternative HTML version deleted]]
2009 Oct 03
2
Calculating the average after adding 3 matrices
Hi all,
Here is my problem:
I have 3 matrices , A, B, C.
Each is an nXn matrix.
I need to create matrix D such that : D[i,j]= (A[i,j]+B[i,j]+C[i,j])/3.
Being a newbie this is proving to be a challenge.
Any ideas on how best to accomplish this?
Thanks!
Anjan
--
=============================
anjan purkayastha, phd
bioinformatics analyst
whitehead institute for biomedical research
nine cambridge
2011 Dec 15
3
From Distance Matrix to 2D coordinates
Dear All,
I am struggling with the following problem: I am given a NxN symmetric
matrix P ( P[i,i]=0, i=1...N and P[i,j]>0 for i!=j) which stands for the
relative distances of N points.
I would like use it to get the coordinates of the N points in a 2D
plane. Of course, the solution is not unique (given one solution, I can
translate or rotate all the points by the same amount and generate
2006 Feb 16
2
Help to find correlation.
Respected Sir,
I am trying to import excel file into R, but I need to truncate some columns from the original file.
How to delete unwanted columns when I import data from excel file.
How to use cor.test for the data when I want the output rowwise.
How to do grouping and use cor.test on that data
I need some help regarding how to calculate the correlation.
I don't know whether you
2006 Jul 21
1
table elemets testing
Hi everybody,
i'm dealing with some percentage tables, of which i should test rowwise if
the entries are sgnificantly equal or not. Namely, on row 1, test H0:
element 1= element2, H0: element 1= element3...H0: element 2= element3...H0:
element n-1= element n. The same on the other rows.
Anybody knows how this can be done in quick way? I don't have large
matrices, but it seems quite