Learn R Programming

provenance (version 4.4)

varietal2distributional: Convert varietal to distributional data

Description

Convert an object of class varietal either to a list of distributional objects by breaking it up into separate elements, or to a single distributional object corresponding to the first principal component.

Usage

varietal2distributional(x, bycol = FALSE, plot = FALSE)

Arguments

x

an object of class varietal.

bycol

logical. If TRUE, returns a list of distributional objects (one for each element). If FALSE, returns a single distributional object (containing the PC1 scores for each sample).

plot

logical. If TRUE, shows the PCA biplot that is used when bycol is FALSE.

Examples

Run this code
Ttn_file <- system.file("SNSM/Ttn_chem.csv",package="provenance")
Ttn <- read.varietal(fn=Ttn_file,snames=3)
varietal2distributional(Ttn,bycol=FALSE,plot=TRUE)

Run the code above in your browser using DataLab