Displaying 20 results from an estimated 100 matches similar to: "dgTMatrix --- [, , drop=F] strange behavior, Matrix 0.999375-20"
2010 Apr 28
1
function which saves an image of a dgtMatrix as png
Hi,
I'm getting crazy:
This does work:
library(Matrix)
a1<-b1<-c(1,2)
c1<-rnorm(2)
aDgt<-spMatrix(ncol=3,nrow=3,i=a1,j=b1,x=c1)
png("myImage.png")
image(aDgt)
dev.off()
But this doesn't !!!
f<-function(x){
png("myImage.png")
image(x)
dev.off()
}
f(aDgt)
My image is saved as a text file and contains nothing at all !!!
Thanks in advance,
Gildas Mazo
2006 Jul 09
1
package:Matrix handling of data with identical indices
In the Matrix package v. 0.995-11 I see that the dgTMatrix
Class for compressed, sparse, triplet-form matrices handles
Identically indexed data instances by summing their values,
e.g.,
library(Matrix)
(Mt <- new("dgTMatrix",
i = as.integer(c(0,0,1,1,4)),
j = as.integer(c(0,1,2,2,4)),
x = as.double(1:5),
Dim = as.integer(c(5,5))))
## 5 x 5 sparse Matrix of class
2006 Jul 09
1
package:Matrix handling of data with identical indices
In the Matrix package v. 0.995-11 I see that the dgTMatrix
Class for compressed, sparse, triplet-form matrices handles
Identically indexed data instances by summing their values,
e.g.,
library(Matrix)
(Mt <- new("dgTMatrix",
i = as.integer(c(0,0,1,1,4)),
j = as.integer(c(0,1,2,2,4)),
x = as.double(1:5),
Dim = as.integer(c(5,5))))
## 5 x 5 sparse Matrix of class
2016 Apr 19
2
Matrix: How create a _row-oriented_ sparse Matrix (=dgRMatrix)?
Using the Matrix package, how can I create a row-oriented sparse
Matrix from scratch populated with some data? By default a
column-oriented one is created and I'm aware of the note that the
package is optimized for column-oriented ones, but I'm only interested
in using it for holding my sparse row-oriented data and doing basic
subsetting by rows (even using drop=FALSE).
Here is what I
2007 May 16
3
Reshape a sparse matrix
Hi,
I'd like to reshape a sparse matrix generated from the Matrix package. I can't seem to do it with the command
dim(A) <- c(6,9)
which works perfectly with the base package matrices, but with the sparse matrices it errors with
Error in dim(A) = c(6, 9) : dim<- : invalid first argument
Manipulating the Dim attribute of the sparse Matrix does not produce the desired effect. A
2007 May 03
1
Issue with the Matrix package
Hi all,
I am wondering if this is a bug in the Matrix package or if it something
that I am just getting wrong...here is an example:
> m = matrix(0,4,4)
> dimnames(m) = list(letters[1:4], letters[5:8])
> r = c("a","b","a","d")
> m[r,2] = 1
> m
e f g h
a 0 1 0 0
b 0 1 0 0
c 0 0 0 0
d 0 1 0 0
> M = Matrix(0,4,4)
> dimnames(M) =
2011 Dec 20
1
column permutation of sparse matrix
Hi,
I'm very new to working with sparse matrices and would like to know how I
can column permute a sparse matrix. Here is a small example:
> M1 <-
> spMatrix(nrow=5,ncol=6,i=sample(5,15,replace=TRUE),j=sample(6,15,replace=TRUE),x=round_any(rnorm(15,2),0.001))
> M1
5 x 6 sparse Matrix of class "dgTMatrix"
[1,] 2.983 . 1.656 5.003 . .
[2,] .
2016 Apr 20
0
Matrix: How create a _row-oriented_ sparse Matrix (=dgRMatrix)?
>>>>> Henrik Bengtsson <henrik.bengtsson at gmail.com>
>>>>> on Tue, 19 Apr 2016 14:04:11 -0700 writes:
> Using the Matrix package, how can I create a row-oriented sparse
> Matrix from scratch populated with some data? By default a
> column-oriented one is created and I'm aware of the note that the
> package is optimized for
2024 Nov 11
0
Matrix - querying dsCMatrix how to save it
I was asked privately
> I have been using <the Matrix package> extensively to
> calculate the relatedness-matrix based on the pedigree for
> our ornamental plants. I was wondering if you could give
> me some advice, for which I would like to thank you in
> advance!
> The output of the relatedness matrix I get from
> the nadiv package is a
2009 Aug 26
1
Problem with standard generic methods in Matrix package
I have posted this message on r-lang, but it is perhaps more appropriate
on r-devel:
---
Hello,
I'm puzzled by a problem with call to diag(), rowSums(), rownames() on
objects of class "dgtMatrix", created by sparseMatrix() or spMatrix().
I use Matrix 0.999375-30.
The weird thing is that I don't encounter any problem when I use this
functions on the R prompt, or
2006 Jul 28
1
arules package: using image() deliveres unexpected results
Dear Collegues,
it seems like there is a problem with the image()-method in the package arules.
Using an ordninary matrix works fine:
image(matrix(rnorm(200), 10, 20), axes = FALSE, col=brewer.pal(9, "Blues") )
delivers an image with blue colors and no axes.
Using an object of the class "associations" (arules package) does not work:
image(items(ta.eclat), axes = FALSE,
2006 Jul 06
1
Warning while subsetting using Matrix package
Hello,
Could someone please explain the following warning while subsetting in
the Matrix package?
Thanks,
John Thaden, PhD
U. Arkansas for Med. Sci.
Little Rock AR USA
> # In the Matrix package...
> library("Matrix")
> # ...I had previously created a sparse matrix in triplet form:
> str(x)
Formal class 'dgTMatrix' [package "Matrix"] with 6 slots
..@ i
2007 May 15
1
Matrix package: writeMM
Hi,
I'm finding that readMM() cannot read a file written with writeMM().
Example:
library(Matrix)
a = Matrix(c(1,0,3,0,0,5), 10, 10)
a = as(a, "CsparseMatrix")
writeMM(a, "kk.mm")
b = readMM("kk.mm")
Error in validObject(.Object) : invalid class "dgTMatrix" object: all row
indices must be between 0 and nrow-1
Thoughts?
Thanks,
-Jose
--
Jose
2011 Apr 20
1
Matrix package transpose
Hi,
Since I installed R 2.13 I cannot use the transpose method "t" on sparse
matrices inside my package. Outside the package works. Is there
something new that I have to import methods? Can I then import
everything from the Matrix package? The problem is that R tries to use
t.default which of course doesn't work.
Happy easter, Tobias
--
Tobias Abenius
Ph.D. Student, M.Sc. in
2009 Oct 24
1
operations on sparse matrices, and dense intermediary steps
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I'm doing some basic operations on large sparse matrices, for example
getting a row.
it takes close to 30 seconds on a 3Ghz machine, and shots the memory
usage up to the sky.
I suspect there are dense intermediary steps (which, if true would
defeat the purpose of trying to use sparse representaitons).
As much as I try understanding the
2012 Jan 18
1
kmeans clustering on large but sparse matrix
Hi,
I have a 60k*600k matrix, which exceed the vector length limit of 2^32-1.
But it's rather sparse, only 0.02% has value. So I save is as MarketMatrix
(mm) file, it's about 300M in size. I use readMM in Matrix package to read
it in. If do so, the data type becomes dgTMatrix in 'Matrix' package
instead of the common matrix type.
The problem is, if I run k-means only on part of
2009 Feb 11
1
Problem with R using pgi compiler on x86_64
Hi,
we have installed R-2.8.1 using the current pgi compiler (8.0.2) for
AMD64 on a SLES9 system.
When I try to install "Matrix" everything is fine until the last step.
make[1]: Leaving directory `/tmp/R.INSTALL.TW3399/Matrix/src/AMD'
pgCC -L/usr/lib64 -L/usr/X11R6/lib64 -pgf90libs -o Matrix.so
CHMfactor.o Csparse.o TMatrix_as.o Tsparse.o init.o Mutils.o
chm_common.o
2010 Dec 01
1
Install package 'Matrix' problem
64-bit R-2.12.0 was installed on Sun SPARC Solaris 10. Compiler used is solstudio12.2. Attached is the configure script.
I then tried to install a recommended package called Matrix. The compilation failed with the following messages,
.......
CC -library=stlport4 -G -L/opt/csw/lib/sparcv9 -L/opt/solstudio12.2/prod/lib/v9 -o Matrix.so CHMfactor.o Csparse.o TMatrix_as.o Tsparse.o init.o Mutils.o
2009 Feb 21
1
R-devel/Linux x64/Sun Studio 12: Problem with Matrix
Dear Developers,
motivated by the new Sun Studio checks I compiled R-devel and several of
our packages with Sun Studio 12 on Fedora x64.
Everything worked fine and R-devel runs, with the exception of package
Matrix where compilation crashes with the following message. The error
occurs during building of the recommended packages and also if Matrix is
compiled separately:
[...]
CC -G -lCstd
2012 Oct 09
4
Convert COLON separated format
I have a bunch of data sets that were created for the libsvm tool. They are in "colon separated sparse format".
i.e.
1 5:1 27:3 345:10
Is a row with the label of "1" and only has values in columns 5, 27, and 345.
I want to read these into a data.frame in R.
Is there a simple way to do this?
--
Noah Silverman, M.S.
UCLA Department of Statistics
8117 Math Sciences