Learn R Programming

provenance (version 4.4)

as.varietal: 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")

Value

an object of class varietal

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).

Examples

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

Run the code above in your browser using DataLab