View source: R/normalization.R
avg_peaks | R Documentation |
Calculates mean curve shape per group (here: species) and rescales result on the y axis to range from 0 to 1.
avg_peaks(df, path.data = NULL)
df |
The resulting tibble of the function |
path.data |
A string character defining where to save the results.
If |
This function returns a tibble made of three columns: species
containing the species names, index
ranging from 1 to 100 for each species,
and force.norm.100
containing the averaged and rescaled curve of each species.
# Using the forceR::df.all.200.tax dataset:
# calculate mean curves per species
peaks.df.100.avg <- avg_peaks(df = forceR::peaks.df.norm.100,
path.data = NULL)
# plot averaged normalized curves per species
require(ggplot2)
ggplot(peaks.df.100.avg,
aes(x = index ,
y = force.norm.100.avg,
colour=species)) +
geom_line()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.