Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

Functions

Joey edited this page May 10, 2022 · 4 revisions

reclarify consists of three separate functions

process_spec_lib

This routine takes the CSV of the spectral library output from the clarity software and trims and transposes the data so that the user can enter the manual groupings and classificaitons that they wish to use. The output should be stored in a data frame, and then can be manipulated or grouped or used for further analysis.

The only argument is file, which can be a relative or absolute path to the file exported from the software.

The output from this routine must be exported as an XLSX file if you wish to combine several libraries using import_spec_lib

import_spec_lib

This routine is only necessary where there are multiple libraries being used for one analysis. The routine takes multiple outputs from the process_spec_lib routine and merges them into one spectral library for further analysis. This allows reference to a 'master' dataset from a remote or local file when running the analysis, allowing mid-process refresh.

Note: The routine takes exported XSLX files, not raw data frames. If you are just using one spectral library, then process_spec_lib is sufficient.

Arguments

lib1file = the full or relative path to the XSLX file containing the first library

lib1sheet = the name of the worksheet that the data is contained within (default = Sheet1)

lib2file = the full or relative path to the XSLX file containing the second library

lib2sheet = the name of the worksheet that the data is contained within (default = Sheet1)

classify_spectral_data

Arguments

LDIRData = (mandatory)

Data frame of LDIR automated particle analysis data from clarity

SpecLib = (mandatory, if you use the above two routines they are generated for you)

This is a dataframe containing two columns: Spectra, the spectral name from the library & and Identification, the grouping or 'family' which the spectra should be binned to. If you use import_spec_lib and process_spec_lib this will be prepared for you.

HitRate = (optional)

The cut-off at which particles will automatically be rejected, defaults to 0.8.

SizeClasses = (optional)

This argument specifies the particle size groupings you want to bin your data by. Default is default: c(0,10,50,100,200,500,900)

Clone this wiki locally