Displaying 20 results from an estimated 36 matches for "matrix1".
Did you mean:
matrix
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, stopwords=NULL, vocabulary=NULL)
print(matrix1,bag_lines = 3, bag_cols = 3)
matrix1 = lw_bintf(matrix1) * gw_idf(matrix1)
spac...
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 <- matrix(0,nrow=nrow(matrix1),nco...
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 t.test(Matrix1$VC1, Matrix2$VC1)$p.value
What is the best way to do i...
2012 Sep 04
2
Read data from .csv file as a matrix and compare the different between two matrix
...mple, the result should appear like this (as below). The result of
this differentiation should also be in matrix table and should be write in .
csv file.
Result of the differences:
A B C
A 0 1 0
B 0 0 0
C 0 0 0
At the mean time, I'm able to load the .csv file and convert it to matrix
matrix1 <-read.table("matrix1.csv", header=T, sep=",")
matrix1 <- as.matrix(matrix1)
matrix2 <- read.table("matrix2.csv", header=T, sep=",")
matrix2 <- as.matrix(matrix2)
But, I can't find a suitable script to compare the differences between the
matr...
2011 Nov 21
0
In-place modification of a matrix
...le 1 below), with huge time and
memory savings.
Is it possible to tweak example 2 to update in place also? The only
difference is that the matrix is held within a new environment.
Thanks,
Simon
# example 1 - fast and doesn't create copies
rm(list=ls())
main <- function() {
matrix1 <- matrix(1.0, nrow=60000, ncol=200)
if (sum(matrix1) == 12000000) { print ("OK") } else { print ("NOT
OK") }
funcExample <- function() eval.parent(substitute({
print(paste("Mem1", memory.size()))
for (i in 1:30...
2009 Aug 18
2
Embedding lists in matrices and matrices in lists
...ge 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 dimensions ncol(matrix1)=x and
nrow(matrix1)=y. So those matrices have to be embedded into lists and
the lists have to be embedded in the big database matrix. If I simply try
database=matrix(0,10,10)
database[4,4]=c(matrix1,matrix2)
I get
Error in database[4, 4] = c(matrix1, matrix2) :
number of ite...
2004 Feb 24
2
matrix() Help
I have a question related to matrix().
The code below randomly generates 3 Poisson numbers into a 3 by 1 matrix:
> matrix1 <- matrix(rpois(3,lambda=2),nrow=3,ncol=1)
And I use list() to see what they are:
[,1]
[1,] 3
[2,] 1
[3,] 4
, which is what I had intended.
I then I want to randomly generate y Normal numbers into a 3 by 8 matrix. y in this case would be 3, 1, and 4; so the resulting matrix should...
2003 Nov 08
1
Can not connect to SWAT
...y (7 nov 03) I had a mostly working 2.27 samba
running on my redhat 9 box that I configured via SWAT. Now I can not get
back into SWAT & I also (in a useless attempt to make it work) upgraded
to samba 3.0 I get the following when trying to start SWAT:
An error occured while loading http://matrix1:901/:
Could not connect to host matrix1 (port 901)
here is my /etc/hosts file:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost.localdomain matrix1
192.168.2.147 philip
192.168.2.145 rob...
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)
matrix5 <- matrix (49:60,4,3)
for...
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
foreach(ii=1:nrow(matrix2)) %:% foreach(jj=1:ncol(matrix2)) %dopar%
{when(matrix2[ii,jj] == 1) %:% {Binary_hex <- c(Binary_hex,
matrix1[ii,jj])}}
During this operation......
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 the command
for such a subtraction?
Thank's a lot.
Felix
---------------
The matrixes (examlple):
1 0.1 0.0042
1 0.2 0.00423
1 0....
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", denscol="black", trace="none", na.rm=T, dendrogram="col", Colv=T)
I would like to show the second matrix with the same row and column ordering of the first matrix.
I...
2012 Sep 19
4
correlating matrices
Hi,
thank you for taking the time and reading my question. My question is
twofold:
1. I have several matrices with variables and one matrix with water levels.
I want to predict the water level with the data in the other matrices.
Basically,
* mod<-lm(matrix1 ~ matrix2+matrix3)*
( What looks like a minus is meant to be the wiggly minus.)
Of course I could dissemble the matrices and paste their columns into one
long, long vector. But the method above gives reasonable results. Are there
any methodological objections against doing this?
2. After having do...
2010 Feb 10
2
system.time provides inaccurate sys.child (PR#14210)
...\
}
WORK_create_matrix(int)
WORK_create_matrix(double)
#undef WORK_create_matrix
#define create_double_matrix(dim1,dim2)\
m_create_double_matrix(dim1,dim2,__LINE__,__FILE__)
int main(int argc, char *argv[])
{
double **matrix1 = create_double_matrix(size, size);
double **matrix2 = create_double_matrix(size, size);
int iterations = 0;
int i,j;
double iter_limit = 100;
alpha = rand();
beta = rand();
while (iterations < iter_limit) {
for (i = 0; i < size; i++) {
for (j...
2010 Jan 08
2
How to Merge based on Rows
Let's say that I have a bunch of matrices.
They look like this (pardon using fruit for examples, my actual data tables
are far too enormous):
Matrix1
Apples Oranges Pears
A 5 6 7
B 5 3 4
C 8 9 10
D 11 13 14
E 15 3 8
F 1 4 5
Matrix2
Apples Oranges Pears
A 5...
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 4000 columns for each
matrix with same row and column n...
2007 Nov 21
1
How to select rows with identical index from two matrix?
Dear list,
I have two martix like these, each rows with name in the matrix.
I try to select rows with identical name from two matrix and calculate their correlation.
Matrix1:
2-Sep 9 5.5 1 7.18 10.0 8 139.45
2-Sep 7 4.9 15 8.22 61.68 9 123.62
4-Sep
5-Sep
AAMP
A2M
A2M
.
.
.
Matrix2:
2-Sep 4 7 1 6.8 12 8 19.4
2-Sep 2 8 15 2.2 6.8 12 13.2
4-Sep
AAMP
AAMP
ABCA5
A2M
A2M
I try...
2009 Feb 26
0
How do I retrieve column and row names after comparing two matrices?
...2 ...
name2 2,0 1,2 1,2 ...
name3 0,2 1,0 2,0 ...
name4 2,0 0,2 0,2 ...
Comparison of both matrices reports a unique difference based on the
following code:
informative<-which(matrix1!=matrix2)
transitions<-napaste(matrix1,matrix2)[informative]
unique_transitions<-unique(transitions)
lfreq<-list(State_transitions=unique_transitions)
lf<-as.data.frame(lfreq)
plot(lf)...
2003 Nov 16
2
Can not add users to samba 3.0
Hello, I can not seem to get smbpsswd to add any users to samba. No
matter if I use the CLI, the Webmin module or SWAT I always get this
response when trying to add any user
[root@matrix1 samba]# smbpasswd -m -a gerard
Failed initialise SAM_ACCOUNT for user gerard$.
Failed to modify password entry for user gerard$
I take it this has somehting to do with PAM & or shadow passwords, & I
have been lookig for a about a week & the best that I can find anything
related to thi...
2012 Oct 26
4
Merge matrices with different column names
A general question that I have been pursuing for some time but have set
aside. When finishing some analysis, I can have multiple matrices that
have specific column names. Ideally, I would like to combine these
separate matrices for a final output as a csv file.
A generic example:
Matrix 1
var1A var1B var1C
x x x
x x