Learn R Programming

soil.spec (version 2.1.3)

average: Averages data with replicate records

Description

Replicate data can be for any type of numeric values. An option to specify if data is spectra or non-spectra is required for this function to determine if to produce spectral signatures of averaged records or not incase of non-spectral data.

Usage

average(spec, type="")

Arguments

spec
Spec is a file with replicate data to be averaged, first column should include duplicated ids to identify rows to be averaged
type
Specify if file with replicate data has spectral data type or not

Value

  • The original replicate spectra is returned together with averaged table. A graphical output of the averaged rows is provided and can be saved from the menu if necessary
  • rep.specReplicated data before averaging
  • averagedData frame of the average

Details

Only numeric columns will be averaged, otherwise NA values will be returned

Examples

Run this code
spec<-read.csv(file.choose())
average(spec,type="spectra")
other<-read.csv(file.choose())
average(other,type="")

Run the code above in your browser using DataLab