Learn R Programming

SPUTNIK (version 1.3.3)

binKmeans,msi.dataset-method: Return a binary mask generated applying k-means clustering on first 10 principal components of peaks intensities.

Description

Return a binary mask generated applying k-means clustering on first 10 principal components of peaks intensities.

Usage

# S4 method for msi.dataset
binKmeans(object)

Arguments

object

Value

ms.image-class object representing the binary mask image.

Examples

Run this code
# NOT RUN {
## Load package
library("SPUTNIK")

## Create the msi.dataset-class object
sz <- c(5, 4)
x <- matrix(rnorm(sz[1] * sz[2] * 20), sz[1] * sz[2], 20)
x[x < 0] <- 0
mz <- sort(sample(100, ncol(x)))
msiX <- msiDataset(x, mz, sz[1], sz[2])

## Generate binary mask by applying k-means on the entire dataset
refBin <- binKmeans(msiX)

## Plot the mask
plot(refBin)
# }

Run the code above in your browser using DataLab