Create the fragment model fits and fit plots for an FIP table.

createFits(
  fileName,
  subSetData,
  instrumentId,
  skipGroupOutput,
  start_lower,
  start_upper,
  lower,
  upper,
  minDataPoints,
  max_iter,
  plotFormat = "PNG",
  plotDimensions = list(width = 11.69, height = 8.27),
  color_scale = ggplot2::scale_colour_hue()
)

Arguments

fileName

the base filename of the FIP table, without the file extension.

instrumentId

the instrumentId of this data.

skipGroupOutput

whether to skip writing of grouping information (for debugging).

start_lower

the lower bound to start the parameter grid search, argument is passed to nls_multstart.

start_upper

the upper bound to start the parameter grid search, argument is passed to nls_multstart.

lower

the lower bound for the parameter estimates, argument is passed to nlsLM.

upper

the upper bound for the parameter estimates, argument is passed to nlsLM.

minDataPoints

the minimum number of data points required per fragment / adduct / ppm combination to be considered for model calculation.

max_iter

the maximum number of iterations of the model to calculate.

plotFormat

the plot format, as supported by ggplot2::ggsave.

plotDimensions

the plot dimensions to use, when printing the plot object to the output device.

color_scale

the ggplot2 color scale to use for fragments.

subsetData

the data subset.

Value

a list with a named entry of 'fits', containing the model fitting results, and a named entry 'fitPlots', containing ggplot grob object for the corresponding plot.