Determine the sparsity of a matrix, distributed, dense, or otherwise.

1 2 3 4 5 6 7 8 9 10 11 | ```
## S4 method for signature 'matrix'
sparsity(x, count = "zero", out = "count",
tol = .Machine$double.eps)
## S4 method for signature 'vector'
sparsity(x, count = "zero", out = "count",
tol = .Machine$double.eps)
## S4 method for signature 'dmat'
sparsity(x, count = "zero", out = "count",
tol = .Machine$double.eps)
``` |

`x` |
numeric matrix |

`count` |
character; options are "zero" and "other". The former counts the number of zeros, while the latter counts the number of non-zeros ('other' elements). |

`out` |
character; options are "count", "proportion", and "percent". This
determines whether a pure count, proportion of |

`tol` |
numeric; the tolerance for numerical zero. This is ignored if the input data is integer/logical. |

The sparsity count of a matrix is returned.

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.