clean_sheet_cary: Organize Cary data

View source: R/clean_sheet_carry.R

clean_sheet_caryR Documentation

Organize Cary data

Description

Cleans the raw data extracted from the Cary 5000 UV-Vis-IR spectrophotometer, ensuring an organized dataset for analysis. During the process, duplicate columns containing wavelength are removed to avoid redundancy. Samples with missing data are also eliminated, ensuring that only complete measurements are retained. Additionally, the columns are reordered based on the sample names, making it easier to interpret and manipulate the data. The wavelength column is placed as the first column, followed by the sample columns.

Usage

clean_sheet_cary(
  data = data,
  prefix = NULL,
  name_wave = "Wave",
  range_wave = c(380, 2500),
  nm_step = 0.5
)

Arguments

data

A data.frame containing the wavelength and reflectance values. It should be obtained directly from the export of a CSV file.

prefix

Indicates the prefix for columns where there is no sample. It is usually predefined as x or ..

name_wave

Indicates the name of the wavelength column. The default is 'wave'.

range_wave

Is the wavelength range used. The default is from 380 nm to 2500 nm.

nm_step

The increment in nanometers between consecutive wavelength readings. This defines the resolution of the measurements. The default value is 0.5 nm.

Value

Returns an organized data.frame

Examples

# example code
library(OxSR)
data(data_cary)

clean_sheet_cary(data_cary, prefix = "x")

# With pipe

data_cary |> clean_sheet_cary(prefix = "x")


OxSR documentation built on April 3, 2025, 10:36 p.m.