as.varietal {provenance}R Documentation

create a varietal object

Description

Convert an object of class matrix or data.frame to an object of class varietal

Usage

as.varietal(x, snames = NULL, method = "KS")

Arguments

x

an object of class matrix or data.frame

snames

either a vector of sample names, an integer marking the length of the sample name prefix, or NULL. read.varietal assumes that the row names of the .csv file consist of character strings marking the sample names, followed by a number.

method

either 'KS' (for the Kolmogorov-Smirnov statistic) or 'W2' (for the Wasserstein-2 distance).

Value

an object of class varietal

Examples

fn <- system.file("SNSM/Ttn_chem.csv",package="provenance")
ap1 <- read.csv(fn)
ap2 <- as.varietal(x=ap1,snames=3)

[Package provenance version 4.3 Index]