subsample_spectra_cols: Subsample spectra and filter spectra to range based on column...

Description Usage Arguments Value

Description

For long spectra we may want to either 1) subsample to lower resolution, so that plots can be made more quickly, or 2) filter down to a specified range of indices, to understand smaller scale phenomena. The first task here can be accomplished by setting subsample_frac; for example, setting subsample_frac = 1/2 will return the spectrum matrix filtered to every other column. For the second task, we require the columns of spectra to be numeric, so we can filter cols on whether they are between x_min and x_max.

Usage

1
2
subsample_spectra_cols(spectra_matrix, subsample_frac = 1, x_min = NULL,
  x_max = NULL)

Arguments

spectra_matrix

An object of class matrix, containing the spectral samples as rows.

subsample_frac

We will only plot ever the value at every 1 / subsample_frac indices. This can accelerate plotting in the case that the spectrum is very long, but can lead to missed peaks.

x_min

What is the minimum index to display?

x_max

What is the maximum index to display?

Value

spectra_matrix A matrix with the same number of rows as the input, but with filtered columns.


krisrs1128/phyloseqExtend documentation built on May 20, 2019, 1:31 p.m.