Learn R Programming

poppr (version 2.5.0)

visible: 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)

distname(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

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.

See Also

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

Examples

Run this code
# NOT RUN {
# }
# 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

# }

Run the code above in your browser using DataLab