wn = seq(400, 1800, by = 1)
x1 = dnorm(wn, mean = 1000, sd = 20) +
0.01 * rnorm(length(wn))
x2 = dnorm(wn, mean = 1002, sd = 20) +
0.01 * rnorm(length(wn))
p1 = raman_find_peaks(x1, height = 0.01, distance = 5)
p2 = raman_find_peaks(x2, height = 0.01, distance = 5)
peak_results = list(
list(
sample_id = "sample1",
wavenumbers = wn,
peaks = p1$peaks,
properties = p1$properties
),
list(
sample_id = "sample2",
wavenumbers = wn,
peaks = p2$peaks,
properties = p2$properties
)
)
features = raman_align_peaks(
peak_results,
tolerance = 4,
feature_method = "max_height"
)
head(features)
Run the code above in your browser using DataLab