Learn R Programming

SBCK (version 1.0.0)

SparseHist: SparseHist

Description

Return the Rcpp Class SparseHistBase initialized

Usage

SparseHist(X, bin_width = NULL, bin_origin = NULL)

Value

[SparseHist] SparseHist class

Arguments

X

[matrix] Dataset to find the SparseHist

bin_width

[vector] Width of a bin for each dimension

bin_origin

[vector] Coordinate of the "0" bin

Examples

Run this code
## Data
X = base::matrix( stats::rnorm( n = 10000 ) , nrow = 5000 , ncol = 2 )
muX = SparseHist(X)

print(muX$p) ## Vector of probabilities
print(muX$c) ## Matrix of coordinates of each bins
print(muX$argwhere(X)) ## Index of bins of dataset X

Run the code above in your browser using DataLab