Learn R Programming

sparta (version 1.0.1)

sparsity: Sparsity

Description

Sparsity

Usage

sparsity(x)

# S3 method for sparta sparsity(x)

# S3 method for sparta_unity sparsity(x)

Value

The ratio of ncol(x) and the total statespace of x

Arguments

x

sparta

Examples

Run this code

x <- array(
  c(1,0,0,2,3,4,0,0),
  dim = c(2,2,2),
  dimnames = list(
    a = c("a1", "a2"),
    b = c("b1", "b2"),
    c = c("c1", "c2")
  )
)

sx <- as_sparta(x)
sparsity(sx)

Run the code above in your browser using DataLab