Learn R Programming

dynutils (version 1.0.11)

is_sparse: Check if an object is a sparse matrix

Description

Check if an object is a sparse matrix

Usage

is_sparse(x)

Arguments

x

An object to test

Examples

Run this code
library(Matrix)
is_sparse(matrix(1:10)) # FALSE
is_sparse(Matrix::rsparsematrix(100, 200, .01)) # TRUE

Run the code above in your browser using DataLab