Displaying 1 result from an estimated 1 matches for "getadjacentassparsematrix".
2009 Aug 26
1
Problem with standard generic methods in Matrix package
...the code is in a package, installed with R CMD INSTALL, and
loaded with library().
I have tried to reduce the package to the bare minimum in order to
discover the problem, but it continue even when reduced up to a single
method, no dependency other than Matrix. The method is defined as:
---
getAdjacentAsSparseMatrix <- function() {
adjacents <- sparseMatrix(i=1:10, j=1:10, x=1:10)
print(class(adjacents));
diagonal <- as.vector(diag(adjacents));
if (any(diagonal != 0)) {
diagonal[diagonal > 1] <- 1;
diag(adjacents) <- diagonal;
}
return(adja...