Skip to content

Commit

Permalink
Update Spectra.Rmd
Browse files Browse the repository at this point in the history
  • Loading branch information
philouail committed Nov 20, 2023
1 parent 8b1eea8 commit 122dfcf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vignettes/Spectra.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -954,10 +954,11 @@ Another way of comparing spectra would be to *bin* the spectra and to cluster
them based on similar intensity values. Spectra binning ensures that the binned
m/z values are comparable across all spectra. Below we bin our spectra using a
bin size of 0.1 (i.e. all peaks with an m/z smaller than 0.1 are aggregated into
one binned peak.
one binned peak. Below, we explicitly set `zero.rm = FALSE` to retain all bins
generated by the function, including those with an intensity of zero.

```{r}
sps_bin <- Spectra::bin(sps, binSize = 0.1)
sps_bin <- Spectra::bin(sps, binSize = 0.1, zero.rm = FALSE)
```

All spectra will now have the same number of m/z values.
Expand Down

0 comments on commit 122dfcf

Please sign in to comment.