Skip to content

Instantly share code, notes, and snippets.

@dirkschumacher
Created July 5, 2019 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dirkschumacher/32d8066c19d98a9f4ca392c8c26c4bf7 to your computer and use it in GitHub Desktop.
Save dirkschumacher/32d8066c19d98a9f4ca392c8c26c4bf7 to your computer and use it in GitHub Desktop.
a <- Matrix::sparseVector(1:2, i = 1:2, length = 2)
b <- Matrix::sparseVector(1:2, i = 1:2, length = 2)
class(a * b)
#> [1] "dsparseVector"
#> attr(,"package")
#> [1] "Matrix"
class(a / b) # bug? numeric instead of sparseVector
#> [1] "numeric"

Created on 2019-07-05 by the reprex package (v0.3.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment