plot_fit: Plot metabCombiner Fits

Description Usage Arguments Value Examples

View source: R/plot_fit.R

Description

This is a plotting method for metabCombiner objects. It displays ordered pairs and a curve fit computed using fit_gam or fit_loess, using base R graphics.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## S4 method for signature 'metabCombiner,ANY'
plot(x, y, ...)

plot_fit(
  object,
  fit = c("gam", "loess"),
  pcol,
  lcol,
  lwd,
  remove.outliers = FALSE,
  ...
)

Arguments

x

metabCombiner object

y

...

...

Other variables passed into graphics::plot

object

metabCombiner object

fit

choice of model (either "gam" or "loess").

pcol

color of the points (ordered pairs) in the plot.

lcol

color of the fitted line in the plot

lwd

line width of the curve fit between anchor points

remove.outliers

logical, option to exclude outlier anchors in plot

Value

no values returned

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(plasma30)
data(plasma20)

p30 <- metabData(plasma30, samples = "CHEAR")
p20 <- metabData(plasma20, samples = "Red", rtmax = 17.25)
p.comb = metabCombiner(xdata = p30, ydata = p20, binGap = 0.0075)
p.comb = selectAnchors(p.comb, tolmz = 0.003, tolQ = 0.3, windy = 0.02)
p.comb = fit_gam(p.comb, k = 20, iterFilter = 1)

##plot of GAM fit
plot(p.comb, main = "Example GAM Fit Plot", xlab = "X Dataset RTs",
     ylab = "Y Dataset RTs", pcol = "red", lcol = "blue", lwd = 5,
     fit = "gam", pch = 19, remove.outliers = TRUE)

grid(lwd =  2, lty = 3 ) #adding gridlines

metabCombiner documentation built on Dec. 10, 2020, 2 a.m.