plot_gauss | R Documentation |
plot_gauss
Plots a peak with the fitted Gaussian curve.
plot_gauss(TIC_df, gauss_return, title = "Peak fit to Gaussian")
TIC_df |
a data.frame object. Data frame with 4 columns (Overall Time Index, RT1, RT2, TIC), ideally the output from create_df(), or the first data frame returned from extract_data(), $TIC_df. |
gauss_return |
a data.frame object. The output from guass_fit(). A data frame with two columns, (time, guassfit), the time values around the peak, and the intensity values fitted to the optimal Gaussian curve. |
title |
a string object. Title placed at the top of the plot. |
This function plots the points around the peak in blue dots, with a
line plot of the Gaussian curve fit to the peak data in red, using
ggplot
from ggplot2 package
\insertCiteggplot2gcxgclab.
A ggplot object. A plot of points around the peak with a line plot of the Gaussian curve fit to the peak data.
file <- system.file("extdata","sample1.cdf",package="gcxgclab")
frame <- extract_data(file,mod_t=.5)
peaks <- top_peaks(frame$TIC_df, 5)
gaussfit <- gauss_fit(frame$TIC_df, peakcoord=c(peaks$'X'[1], peaks$'Y'[1]))
message(paste('Area under curve =',gaussfit[[3]], 'u^2'))
plot_gauss(frame$TIC_df, gaussfit[[1]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.