RamanWrapper: Use this wrapper function for calling Ramanpk

View source: R/peakfitting.R

RamanWrapperR Documentation

Use this wrapper function for calling Ramanpk

Description

I wanted to run the diffractometry peak-analysis code (which can be both time-consuming and prone to stray errors halting compilation) without the need to re-run the peak analysis every time the document is re-compiled. For that purpose, I created this wrapper function. Its job is to call Ramanpk only if necessary (i.e., peak analysis has not already been performed). That is made possible by saving the results of a successful analysis to a file on disk (in the current working directory). Also includes an override option to force re-running of peak analysis.

Usage

RamanWrapper(
  data.exp,
  run,
  override = FALSE,
  kerpk = 1,
  fitmaxiter = 50,
  gam = 0.6,
  scl.factor = 0.1,
  tau = 2,
  maxwdth = 200,
  jobfile = ""
)

Arguments

data.exp

dataframe with experimental data (format?)

run

index

override

force re-running of peak analysis

kerpk

number of kernels per peak (passed to Ramanpk())

fitmaxiter

number of max iterations while attempting fit (passed to Ramanpk())

gam

gam (passed to Ramanpk())

scl.factor

sclerosis factor (passed to Ramanpk())

tau

tau (passed to Ramanpk())

maxwdth

peak max width (passed to Ramanpk())

jobfile

path to datafile saved to disk, defaults to ./raman-peak-data.rda

Value

a Ramanpk dataframe


chepec/renishaw documentation built on Sept. 1, 2022, 2:41 p.m.