Learn R Programming

msentropy (version 0.1.4)

calculate_spectral_entropy: Calculate spectral entropy of a spectrum

Description

Calculate spectral entropy of a spectrum

Usage

calculate_spectral_entropy(peaks)

Value

A double value of spectral entropy.

Arguments

peaks

A matrix of peaks, with two columns: m/z and intensity.

Examples

Run this code
mz <- c(100.212, 300.321, 535.325)
intensity <- c(37.16, 66.83, 999.0)
peaks <- matrix(c(mz, intensity), ncol = 2, byrow = FALSE)
calculate_spectral_entropy(peaks)

Run the code above in your browser using DataLab