add_noise_MD {ontophylo}R Documentation

Adding noise to MDS from one stochastic character map

Description

Adds noise to the points in the 2D coordinates in the MDS plot. # The noise is calculated as var(V)*add.noise.

Usage

add_noise_MD(MD, add.noise)

Arguments

MD

tibble. The output of a MD_morpho function.

add.noise

numeric. A vector of length 2 indicating the amount of noise to be added to the x and y coordinates.

Value

A list of tibbles as in the output of MD_morpho functions, with noise added.

Author(s)

Sergei Tarasov

Examples

data("hym_stm_mds")
# Select a few taxa from main lineages of Hymenoptera.
tax <- c("Xyela", "Tenthredo", "Orussus", "Pimpla",
         "Ceraphron", "Evania", "Pison",
         "Ibalia", "Proctotrupes", "Chiloe") 
drop_tax <- hym_stm_mds$tip.label[!hym_stm_mds$tip.label %in% tax]
hym_stm_mds <- phytools::drop.tip.simmap(hym_stm_mds, drop_tax)
# Get a sample of amalgamated stochastic map (phenome).
tree <- merge_tree_cat(hym_stm_mds)



  # Multidimensional scaling for an arbitrary tree.
  MD <- suppressWarnings(MultiScale.simmap(tree))

  # Add noise.
  add_noise_MD(MD, c(0.3, 0.3))




[Package ontophylo version 1.1.3 Index]