MLG-accessors: Accessors for the MLG object

visibleR Documentation

Accessors for the MLG object

Description

This documentation is for developers of poppr. The accessors here are preferred over accessing the elements via the @ symbol. Please use these in your code when accessing MLG objects.

Usage

visible(x)

visible(x) <- value

MLG2df(x)

distname(x)

distenv(x)

distname(x) <- value

distenv(x) <- value

distargs(x)

distargs(x) <- value

distalgo(x)

distalgo(x) <- value

cutoff(x)

cutoff(x) <- value

Arguments

x

an MLG object

value

see details

Details

These accessors are intended for internal use only. They only affect MLG objects, not genind objects. Only visible and MLG2df are general for all forms of MLG. The distargs and cutoff are specific for use in mlg.filter or any function that offers filtering as an option. The argument "value" will always take the type defined in the MLG class.

Value

see details

See Also

MLG genclone genlight initialize,MLG-method levels,MLG-method unique,MLG-method

Examples


## Not run: 
# These examples will simply show you what you can do with these
set.seed(5000)
(x <- sample(10, 20, replace = TRUE))
(m <- new("MLG", x))

# Visibility ------------------------------
visible(m) # original
visible(m) <- "contracted"
m          # shows contracted MLGS

# Conversion to data frame ----------------
MLG2df(m)  # Grab the internal data frame

# Distance function handling --------------
distname(m) # nei.dist
distargs(m) # list()
distalgo(m) # farthest
cutoff(m)

distname(m) <- substitute("diss.dist")
distargs(m) <- list(percent = TRUE)
distalgo(m) <- "average"
cutoff(m)["contracted"] <- 0.2


## End(Not run)

poppr documentation built on March 31, 2023, 7:15 p.m.