add_peaks: Add peak indicators at the given indices

Description Usage Arguments Value Examples

View source: R/peak_pick.R

Description

Add peak indicators at the given indices

Usage

1
add_peaks(df, indices)

Arguments

df

Dataframe with dataset (e.g. x- and y-values of a spectrum)

indices

Vector of integer indices indicating peak positions

Value

tbl_df with an additional column indicating whether the row is a peak

Examples

1
2
3
library(tidyverse)
tibble(x1 = seq(0.1, 9, 0.01), y1 = sin(x1)) %>%
  add_peaks(c(148,776))

SPOMAN/osc documentation built on May 14, 2019, 7:41 a.m.