Displaying 20 results from an estimated 2000 matches similar to: "Matrix multiplication with scattered NA values"
2012 Sep 04
2
Read data from .csv file as a matrix and compare the different between two matrix
Hi,
I have two table matrix, and I would like to compare the different between
two matrix.
For example:
Matrix 1:
A B C
A 0 1 0
B 0 0 1
C 0 0 0
Matrix 2:
A B C
A 0 1 0
B 0 0 0
C 0 0 0
Each column which have value 1, should also return value 1. As in this
case/example, the result should appear like this (as below). The result of
this differentiation should also be in matrix
2007 May 04
2
Get the difference between two matrices with different length
Hello,
I have got two matrices with different length. The matrices have 3
columuns. The first two are coordinates. The third is a measurement.
Now I want to get a subtraction between every single value of the
third column (between matrix1 and matrix2), but only if the two
first coordinates in matrix1 and matrix2 are the same.
I tried "FUN=?" in aggregate and ave, but I don't know
2007 Nov 19
1
using two different matrix : how to do t.test
I have two matrix with same dimensions. I want to do t.test using each column
from 2 different matrix.
Column names in both matrix are same.
e.g.
Matrix1
id VC1 VC2 VC3
R 1 2 3
R1 4 5 6
R3 7 8 9
Matrix2
id VC1 VC2 VC3
R 10 11 12
R1 13 14 15
R3 16 17 18
want to do t.test
for eg t.test(Matrix1$VC1, Matrix2$VC1)$p.value
What is the best way to do it. I have dataset with
2007 Nov 19
6
Reg : using two different matrix : how to do t.test
I have two matrix with same dimensions. I want to do t.test using each column from 2 different matrix.
Row n Column names in both matrix are same.
e.g.
Matrix1
id VC1 VC2 VC3
R 1 2 3
R1 4 5 6
R3 7 8 9
Matrix2
id VC1 VC2 VC3
R 10 11 12
R1 13 14 15
R3 16 17 18
want to do t.test using each column (with same name ) using Matrix1 and Matrix2
for eg
2007 Nov 23
0
R users in Cyprus
Dear friends, are there enough R users in Cyprus to form a club?
jason
Dr. Iasonas Lamprianou
Department of Education
The University of Manchester
Oxford Road, Manchester M13 9PL, UK
Tel. 0044 161 275 3485
iasonas.lamprianou at manchester.ac.uk
----- Original Message ----
From: "r-help-request at r-project.org" <r-help-request at r-project.org>
To: r-help at r-project.org
2010 Feb 22
1
rownames cannot allocate vector of size
Hi,
On R 2.10.1 for Windows, when I do the following to duplicate the
structure of a large numeric matrix called matrix1:
matrix2 <- matrix(0,nrow=nrow(matrix1),ncol=ncol(matrix1))
and then
rownames(matrix2) <- rownames(matrix1)
I get a "cannot allocate vector of size xxMb" error
but if I instead do:
rnames <- list()
rnames <- rownames(matrix1)
matrix2 <-
2009 Feb 26
0
How do I retrieve column and row names after comparing two matrices?
Hello, I have two matrices as shown below:
Matrix 1
ID AB1 BC1 CD1 ...
name1 1,1 2,1 0,2 ...
name2 2,0 1,2 1,2 ...
name3 0,2 1,1 2,0 ...
name4 2,0 0,2 0,2 ...
Matrix 2
ID AB2 BC2 CD2 ...
name1 1,1
2007 Aug 18
2
Problem with lsa package (data.frame) on Windows XP
Dear R team,
The following piece of code (to use the lsa package) works fine on my
mac os x, but when I run the same code on Windows XP, it doesn't work
any more.
### code:
library("lsa")
matrix1 = textmatrix("C:\\Documents and Settings\\tine stalmans.TINE.
000\\LSA\\cuentos\\", stemming=TRUE, language="spanish",
minWordLength=2, minDocFreq=1,
2006 May 16
0
reordering materix presentation in heatmap.2 in the 'gplots' library
Dear R users,
I'm trying to create images of 2 symmetrical matrices using heatmap.2 of the 'gplots' library. Both matrices have the same row and column names
For the first matrix I'm using the default clustering and column denrogram options:
heatmap.2(Matrix1, symm=T, breaks=20, col=rich.colors(19), main="matrix1", density.info="histogram",
2012 Aug 02
1
Filter a matrix with a matrix HELP!
Hi,
just during these vacation days, I'm trying to approach with multicore
package
and I have some troubles with foreach.
What I'm trying to do is to extract a data in coordinate (ii,jj) from a
matrix2,
only if the data in the same coordinate in matrix1 is ==1.
Make this with a nested "for" take a lot of time because I have thousand of
values.
ex.
Binary_hex = NULL
2010 Feb 12
3
Code working but too slow, any idea for how to speed it up ?(no loop in it)
Hello my friends,
here is a code I wrote with no loops on matrix that is taking too long (2
seconds and I call him 720 times --> 12 minutes):
mat1 and mat2 are both matrix with 103 columns and 164 rows.
sequence <- matrix(seq(1 : ncol(mat1)))
returns <- apply(sequence, 1, function, mat1= mat1, mat2 = mat2, day = 1)
function<- function(mat1, mat2, colNb, day){
2012 Jun 14
0
fixed trimmed mean for j-group
Hello...i want to find the empirical rate for type 1 error using fixed
trimmed mean. To make it easy, i'm referring to journal given by this
website
http://www.academicjournals.org/ajmcsr/PDF/pdf2011/Yusof%20et%20al.pdf.
I already run the programme and there is no error in it but i got zero for
the empirical rate of type 1 error. The empirical rate for the type 1 error
given in the journal
2007 Nov 12
1
update matrix with subset of it where only row names match
I guess this has a simple solution:
I have matrix 'mat1' which has row and column names, e.g.:
A B C
row1 0 0 0
row2 0 0 0
....
rown 0 0 0
I have a another matrix 'mat2', essentially a subset of 'mat1' where the
rownames are all in 'mat1' e.g.:
B
row3 5
row8 6
row54 7
I want to insert the values of matrix mat2 for column B (in reality it
could be some or
2012 Jul 07
0
fixed trimmed mean for group
Hello,
I haven't found errors in your code. I implemented the test in the paper
(the first, fixed symetric mean) and it also gives me zero Type I
errors, when alpha = 0.05. Try to see the value of min(pv) or to plot
the histogram of 'pv', hist(pv) and you'll see that there are no
significant p-values, at that level.
Anyway I'll continue to look at it, but my first
2010 Feb 10
2
system.time provides inaccurate sys.child (PR#14210)
Full_Name: Manuel L?pez-Ib??ez
Version: R version 2.6.2 (2008-02-08)
OS: linux-gnu
Submission from: (NULL) (164.15.10.156)
This is only relevant for CPU intensive child processes. Otherwise, the problem
is not obvious.
Therefore, we need a CPU intensive program like this one:
/************************************/
/*** Compile with: gcc -o timer-test -O0 timer-test.c -lm */
#include
2009 Aug 18
2
Embedding lists in matrices and matrices in lists
Hi,
I'm new to programming, new to R and even new to mailing lists so please
be patient with me. I need to manage many matrices generated by an R
program. These matrices have different dimensions and I'd like to group
them somehow. The best way would be to have a big matrix (let's call it
database) where every element database[x,y] consists of a list of
matrices that all have the
2010 Oct 23
1
bind matrices by row
Hi R-users
I have a series of matrices and I would like to bind them together by
column using a loop (i.e. not writing cbind(matrix1,
matrix2,matrix3....)). The reason is because in my real data set I have
a very large number of matrices.
Example:
matrix1 <- matrix (1:12,4,3)
matrix2 <- matrix (13:24,4,3)
matrix3 <- matrix (25:36,4,3)
matrix4 <- matrix (37:48,4,3)
2005 Nov 03
4
merging dataframes
Dear List,
I often have to merge two or more data frames containing unique row
names but with some columns (names) common to the two data frames and
some columns not common. This toy example will explain the kind of setup
I am talking about:
mat1 <- as.data.frame(matrix(rnorm(20), nrow = 5))
mat2 <- as.data.frame(matrix(rnorm(20), nrow = 4))
rownames(mat1) <- paste("site",
2007 Jul 24
1
cor inside/outside a function has different output
I'm calculating correlations between two matrices
mat1 <- matrix(sample(1:500,25), ncol = 5,
dimnames=list(paste("mat1row", 1:5, sep=""),
paste("mat1col", 1:5, sep="")))
mat2 <- matrix(sample(501:1000,25), ncol = 5,
dimnames=list(paste("mat2row", 1:5, sep=""),
paste("mat2col", 1:5, sep="")))
2010 Oct 14
1
rbind ing matrices and resetting column numbers
Sorry for the verbose example. I want to row bind two matrices, and all works except I want the column labelled "row" to be sequential in the new matrix, shown as "mat3" here, i.e. needs to be 1:6 and not 1:3 repeated twice. Any suggestions?
Thanks
J
> colnm1 <- c("row","ti","counti")
> colnm2 <-