Displaying 20 results from an estimated 8000 matches similar to: "0-extent matrices?"
2012 Aug 23
1
Why was my R process killed spontaneously?
I tried to use gpuCor function in the gputools package of R to calcuate the
pairwise correlations of a matrix of 40,000 columns.
Becuase there would be memory issues if I use the whole matrix at a time, I
splitted the matrix into submatrix of 10,000 columns and then calculate the
pairwise correlation of different submatrices. There are altogether 4
submatrices, so I need to calculate the pearson
2004 Sep 15
2
efficient submatrix extraction
Hi,
I have a matrix of say 1024x1024 and I want to look at it in chunks.
That is I'd like to divide into a series of submatrices of order 2x2.
| 1 2 3 4 5 6 7 8 ... |
| 1 2 3 4 5 6 7 8 ... |
| 1 2 3 4 5 6 7 8 ... |
| 1 2 3 4 5 6 7 8 ... |
...
So the first submatrix would be
| 1 2 |
| 1 2 |
the second one would be
| 3 4 |
| 3 4 |
and so on. That is I want the matrix to be evenly divided
2002 Oct 10
2
tapply for matrices
Does anyone have something like tapply that is extremely fast for matrices when there is a very large number of levels of the grouping variable?
I'm referring to, for example,
tapply(x, grouping.variable, function.operating.on.submatrix)
where x is a matrix and the submatrix is a subset of the rows of x. The grouping variable's length equals the number of rows of x.
--
Frank E
2007 Apr 25
1
for loops
Hello everybody
I'm very new at using R so probably this is a very stupid question.
I have a matrix of "p" columns and I have to calculate for each of them the "two sample t-statistic" and p-value and to save the results into two different vectors.
I have divided my matrix into two submatrices: submatrix A containing the first "n1" rows (p columns) and submatrix B
2012 Oct 22
4
Help with applying a function to all possible 2x2 submatrices
Hi all,
I'm working with a large data set (on the order of 300X300) and trying to
apply a function which compares the elements of all possible 2x2
submatrices. There are rc(r-1)(c-1) such submatrices, so obviously the naive
method of looping through the rows and columns is computationally unfeasible
for my data set:
for(i in 1:(nrow(data)-1)) {
for(j in (i+1):nrow(data)) {
for (m
2002 Feb 01
3
matrix with ncol=1
Hello list,
I try to optimize some R code and it turns out that the function as.matrix
takes a lot of time in my code. There is only one reason why I need
as.matrix: My code should work for matrices with ncol=p and p should be
allowed to be 1 or larger.
Now I have a matrix x with dim(x)=(n,p), and
I need to work with the submatrix y <-x[gv,], (gv a vector of
n logicals) and to calculate
2011 Aug 02
1
Functions for Sum of determinants of ranges of matrix subsets
Dear R-help list,
Pls I have this problem. Suppose I have a matrix of size nxn say, generated as follows
z<-matrix(rnorm(n*n,0,1),nrow=n)
I want to write a function such that for i in 1:n, I will remove the rows and columns
corresponding to i (so, will be left with n-1*n-1 submatrix in each cases). Now I need
the sum of the determinant of each of this submatrices. As an example, if n=3, it
2004 Jan 26
3
write.table file="file.txt" help
Hi all,
I have a R script that creates several input files for an analysis
program. It loops through the matrix read into R and picks out
submatrices and then creates a separate output file for each
submatrix. The loop works great, but I am having trouble getting all
the separate output files written.
The line I have is:
write.table(ch1d,
1997 Apr 28
1
R-alpha: R-beta:matrix & vector multiplication.
Both of these used to work and seem useful and harmless:
R> matrix(1,ncol=1)%*%c(1,2)
Error in matrix(1, ncol = 1) %*% c(1, 2) : non-conformable arguments
R> matrix(1,ncol=1)*(1:2)
Error: dim<- length of dims do not match the length of object
Thomas Lumley
-----------------------------------------------------+------
Biostatistics : "Never attribute to malice what :
Uni of
1997 Apr 28
1
R-alpha: R-beta:matrix & vector multiplication.
Both of these used to work and seem useful and harmless:
R> matrix(1,ncol=1)%*%c(1,2)
Error in matrix(1, ncol = 1) %*% c(1, 2) : non-conformable arguments
R> matrix(1,ncol=1)*(1:2)
Error: dim<- length of dims do not match the length of object
Thomas Lumley
-----------------------------------------------------+------
Biostatistics : "Never attribute to malice what :
Uni of
2007 Jul 26
0
Diagonal Submatrices Extraction
Yes you are right ... an example is mandatory.
So ... I have a matrix of 0 with just a single 1 per row and per column
I need to extract all maximal 'diagonal' submatrices
Let's say I have the following matrix
A B C D E
a 0 1 0 0 0
b 1 0 0 0 0
c 0 0 1 0 0
d 0 0 0 1 0
e 0 0 0 0 1
well I would like to get, for this example, the two following submatrices
A B C D E
1997 Apr 01
0
R-beta: Re: R-alpha: My two problems
On Tue, 1 Apr 1997, Jim Lindsey wrote:
> Neither setting environment nor command
> line change memory size as given by gc(). However, if I give too small
> or too large a value on the command line, it tells me that it is
> invalid and is ignoring it!?? I repeat that when I recompiled changing
> the default size, gc() changed its values. Am I misunderstanding
> something?
I
1997 Aug 21
0
R-beta: problem with gee() with singletons
A bug (misfeature) has been found in the S gee library (and thus in the R
gee library). The problem, which is shared by nearly all gee
implementations, involves the calculation of working correlations when
some clusters have only one observation. For compatibility reasons nearly
everyone uses the computing formula from the first SAS macro by Karim,
rather than the formula from the original GEE
1997 Oct 08
0
R-beta: calling R from FORTRAN
There was a question earlier today, on either r-help or r-devel, about
calling R code from FORTRAN (I deleted it accidentally, so I don't know
which list it belonged to).
Anyway, there is a workaround to call R functions from FORTRAN which is
used in the "integrate" library. It was invented for S by Mike Meyer. The
FORTRAN code needs to be written to call a fixed C function and
1997 Apr 08
1
R-alpha: rbind
rbind() does something strange to dimnames
R : Copyright 1997, Robert Gentleman and Ross Ihaka
Version 0.50 Beta (April 1, 1997)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type "license()" for details.
> test1 <- data.frame(time= c(4, 3,1,1,2,2,3),
+ status=c(1,NA,1,0,1,1,0),
+ x= c(0,
1997 Aug 31
1
R-alpha: ?bug in [.data.frame
If you subscript a data frame using the names of the columns and there is
more than one column with the same name only the first one is found.
eg
mm<-data.frame(1:10,log(1:10))
names(mm)<-c("(offset)","(offset)")
mm[,"(offset)"] # only returns first column
mm[,"(offset)"]<-rep(1,10) # only sets first column
This *is* compatible with S, but I
1997 Oct 01
1
R-alpha: R-beta: hat
The hat() function, returning the diagonal of the hat matrix, currently
works only on matrices and doesn't work with weights. Could we make it
return lm.influence(x)$hat when inherits(x,"lm")?
Thomas Lumley
------------------------------------------------------+------
Biostatistics : "Never attribute to malice what :
Uni of Washington : can be adequately explained by :
2011 Apr 27
2
sub-matrix block size
Dear Rxperts
Below is a small vector of values of zeros and non-zeros... was wondering if
there is an efficient way to get the block sizes of submatrices of a big
matrix similar to the one shown below? diagonal elements can be zero too.
Rows with only a diagonal element may be considered as a unit block size.
c(1,0,0,0,0,0,0,0,0,0,0,
1,1,0,0,0,0,0,0,0,0,0,
0,0,1,0,0,0,0,0,0,0,0,
2012 Jul 15
4
extracting rows and columns from a big matrix
Hi there and thanks in advance.
I have a large symmetrical matrix stored in a text file. After load in R I would like to extract the same number of columns and rows (symmetrical submatrix) using their labels.
I have tried this code in order to extract columns, but R console gives me the "+" sign at the end of the code, pointing out incomplete command, so it is not working:
2016 Jun 25
2
strange behavior in 'inherits' check for loaded S4 object
Hi,
(sorry for the wall of text; the issue here appears to be rather complicated)
I'm seeing a somewhat strange case where checking whether an S4 object
inherits from a parent class defined from another package with
'inherits' fails if that object is materialized through a call to
'load'. That's a mouthful, so I've put together a relatively small
reproducible example