Displaying 20 results from an estimated 6000 matches similar to: "Dispatching on a dgCMatrix does not work."
2009 Sep 11
2
Graph visualization
Hello,
I am working with graph and adjacency matrix, the package 'graph' seems to be appropriate for this.
An example in the package
> mat <- rbind(c(0, 0, 1, 1),
+ c(0, 0, 1, 1),
+ c(1, 1, 0, 1),
+ c(1, 1, 1, 0))
> rownames(mat) <- colnames(mat) <- letters[1:4]
> graph1 <- new("graphAM", adjMat=mat)
> graph1
A
2012 Jul 28
1
Creating sparse matrix of type "dgCMatrix" directly
I want to create a sparse matrix of type "dgCMatrix" using the Matrix package (and the matrix must be of this type even if other more compact representations may exist). I do
> library(Matrix)
> m1<-Matrix(rep(1,4),nrow=2,ncol=2,sparse=T)
> m1
2 x 2 sparse Matrix of class "dsCMatrix"
[1,] 1 1
[2,] 1 1
To convert m1, I do
> as(m1, "dgCMatrix")
2017 Oct 20
0
What exactly is an dgCMatrix-class. There are so many attributes.
Subsetting using [] vs. head(), gives different results.
R code:
> head(train$data, 5)
[1] 0 0 1 0 0
> train$data[1:5, 1:5]
5 x 5 sparse Matrix of class "dgCMatrix"
cap-shape=bell cap-shape=conical cap-shape=convex
[1,] . . 1
[2,] . . 1
[3,] 1 .
2012 Oct 09
1
converting dgCMatrix to regular matrix
Hi: I've looked around and I must be missing it because it's probably
somewhere. Does someone know how to convert an object of class dgCmatrix
to a regular matrix. I can send someone the data if they need it but it's
too big to include here.
I read the data in using
temp<-readMat("movielens.mat")
where readMat is from the R.matlab package. But the resulting 2 matrices
2017 Oct 20
0
What exactly is an dgCMatrix-class. There are so many attributes.
> On Oct 20, 2017, at 11:11 AM, C W <tmrsg11 at gmail.com> wrote:
>
> Dear R list,
>
> I came across dgCMatrix. I believe this class is associated with sparse
> matrix.
Yes. See:
help('dgCMatrix-class', pack=Matrix)
If Martin Maechler happens to respond to this you should listen to him rather than anything I write. Much of what the Matrix package does appears
2017 Oct 21
1
What exactly is an dgCMatrix-class. There are so many attributes.
> On Oct 21, 2017, at 7:50 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote:
>
>>>>>> C W <tmrsg11 at gmail.com>
>>>>>> on Fri, 20 Oct 2017 15:51:16 -0400 writes:
>
>> Thank you for your responses. I guess I don't feel
>> alone. I don't find the documentation go into any detail.
>
>> I also find
2017 Oct 21
0
What exactly is an dgCMatrix-class. There are so many attributes.
>>>>> C W <tmrsg11 at gmail.com>
>>>>> on Fri, 20 Oct 2017 15:51:16 -0400 writes:
> Thank you for your responses. I guess I don't feel
> alone. I don't find the documentation go into any detail.
> I also find it surprising that,
>> object.size(train$data)
> 1730904 bytes
>>
2017 Oct 20
3
What exactly is an dgCMatrix-class. There are so many attributes.
Dear R list,
I came across dgCMatrix. I believe this class is associated with sparse
matrix.
I see there are 8 attributes to train$data, I am confused why are there so
many, some are vectors, what do they do?
Here's the R code:
library(xgboost)
data(agaricus.train, package='xgboost')
data(agaricus.test, package='xgboost')
train <- agaricus.train
test <- agaricus.test
2017 Oct 20
4
What exactly is an dgCMatrix-class. There are so many attributes.
Thank you for your responses.
I guess I don't feel alone. I don't find the documentation go into any
detail.
I also find it surprising that,
> object.size(train$data)
1730904 bytes
> object.size(as.matrix(train$data))
6575016 bytes
the dgCMatrix actually takes less memory, though it *looks* like the
opposite.
Cheers!
On Fri, Oct 20, 2017 at 3:22 PM, David Winsemius
2019 Apr 22
1
R-devel (rev 76409) fails 'make check': non-generic function 'isSymmetric' given to findMethods()
Duncan that does indeed look to be the case. Many thanks!
In particular, tests/reg-tests-1d.R optionally loads the Matrix
namespace which allows the test to succeed. Compare:
~/R-rc_2019-04-21_r76409/bin/Rscript -e "options(warn=2);
library(Matrix); res <- findMethods('isSymmetric'); print('success')"
[1] "success"
versus
2009 Jul 20
1
S4 method dispatch with inheritance
Hi,
I'm trying to create a new S4 class (myMatrix) which for now just
extends dgCMatrix (from package Matrix). Then I want to use "[" which is
defined in Matrix.
Out of the box with "[" (defined in Matrix) I lose the class information
and the result is an object of class dgCMatrix. If I specify a
"["-method for myMatrix, it is not used because a signature
2009 Oct 12
1
unexpected behaviour of isSymmetric() (PR#14000)
Full_Name: Mike Danilov
Version: 2.9.0
OS: Fedora Core 9
Submission from: (NULL) (142.103.121.198)
When checking for the symmetry of a matrix, function isSymmetric.matrix() gets
confused by the discrepancy of colnames/rownames if its argument. See the code
snippet below. Perhaps it's a problem of the matrix product which copies
colnames of the first argument but not the rownames of the
2019 Apr 21
2
R-devel (rev 76409) fails 'make check': non-generic function 'isSymmetric' given to findMethods()
Hello,
Most likely I'm doing something wrong, but am at a loss as to what the
issue is. I have a clean checkout of trunk here:
?? ~/svn/r-devel/R$ svn info
?? Path: .
?? Working Copy Root Path: /home/btyner/svn/r-devel/R
?? URL: https://svn.r-project.org/R/trunk
?? Relative URL: ^/trunk
?? Repository Root: https://svn.r-project.org/R
?? Repository UUID:
2011 Aug 23
0
Matrix:::qr.qy and signature(qr = "sparseQR", y = "dgCMatrix")
> sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Matrix_0.999375-50 lattice_0.19-30
loaded via a namespace (and not attached):
[1] grid_2.13.1
2009 May 15
1
Matrix package,solve() errors and crashes Please help
>
> Hello All,
>
Please help me with this problem.I have been having this problem for over a
month now and I could not find any information.I later realised that error
is with MATRIX package.
I am working on graph object using IGRAPH version 0.5.2-2 package & wanted
to do Bonacich Power.
What I have is undirected GRAPH.
This is my graph object.
The file 'Bonacich
2007 Aug 28
4
Nodes & edges with similarity matrix
Hello,
I apologise if someone has already answered this but I searched and
googled but didn't find anything.
I have a matrix which gives me the similarity of each item to each
other. I would like to turn this matrix into something like what they
have in the graph package with the nodes and edges.
http://cran.r-project.org/doc/packages/graph.pdf . However I cannot find
a method to
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
2018 Apr 23
4
R 3.5.0 fails its regression test suite on Linux/x86_64
Hi,
I just tried to upgrade Nixpkgs to R 3.5.0, but unfortunately the new
version fails its regression test suite. We configure the build using
the flags "--without-recommended-packages", in case that's relevant. You
can see a complete build log with all relevant information at [1].
Anyway, the test failures look like this:
| make[3]: Entering directory
2010 Nov 07
2
is this matrix symmetric
Hi,
I have this symmetric matrix, at least I think so.
col1 col2 col3
[1,] 0.20 0.05 0.06
[2,] 0.05 0.10 0.03
[3,] 0.06 0.03 0.08
or
structure(c(0.2, 0.05, 0.06, 0.05, 0.1, 0.03, 0.06, 0.03, 0.08
), .Dim = c(3L, 3L), .Dimnames = list(NULL, c("var1", "var2",
"var3")))
But isSymmetric() doesn't agree. Any comment? I am on R 2.10.1 Thanks.
Jun