plotdefo: plotdefo

Description Usage Arguments Author(s) Examples

Description

This function displays in 2D the deformations associated typically to a procsym object from procSym() function in package "Morpho" (Stefan Schlager (2016). Morpho: Calculations and Visualisations Related to Geometric Morphometrics. R package version 2.4.1.1.https://github.com/zarquon42b/Morphor). However, the input list could contain any type of reference matrix, ordination scores and eigenvectors named "mshape" "PCscores" and "PCs" respectively.

Usage

1
2
3
4
5
6
7
8
plotdefo(procsymobject, zlim = NULL, linkss = NULL, linkst = NULL,
  colss = 1, colst = 2, lwds = 2, lwdt = 2, cexs = 0, cext = 0,
  displ = F, axtit = NULL, mag = 1, heat = T, mfrow = c(3, 2),
  mar = c(0, 0, 0.3, 0), mai = c(0, 0, 0.3, 0), oma = c(0, 0, 3, 0),
  colors = c("blue4", "cyan2", "yellow", "red4"), alpha = 1, magrange = 1,
  exts = rep(0, 6), PB = NA, PA = NA, S = NA, SB = NA, H = NA,
  V = 3, a = NULL, q = NULL, Y = FALSE, j = FALSE, D = FALSE,
  St = Inf, Q = TRUE, constr = T, pholes = NA)

Arguments

procsymobject

list: a list with three objects with the following names: "mshape" a kx2 matrix which is deformed according to the values and eigenvectors specified in the other two arguments; "PCscores" ordination scores coming from an ordination analysis; "PCs" eigenvectors relative to "mshape" and "PCscores". By default the function takes the first three PCscores columns and the first three PCs column to build the plot. The list can be built manually in order to contain the desired PCscores and PCs combination. If links are provided the heatmap is computed in the constrained Delaunay triangulation defined by the links. Otherwise the Delaunay triangulation is not constrained.

zlim

numeric: zlim range for heat (if TRUE) color.

linkss

numeric: links for source configuration; if heat=T these (as well as "linkst" argument) must identify a closed contour in order to allow the Delaunay triangulation constrained within the external border.

linkst

numeric: links for target configuration

colss

numeric: landmarks color for source

colst

numeric: landmarks color for target

lwds

numeric: links width for source

lwdt

numeric: links width for target

cexs

numeric: cex parameter for landmarks of source

cext

numeric: cex parameter for landmarks of target

displ

logical: if TRUE displacement vectors are displayed

axtit

character: if NULL it uses as defaults: c("PC1+", "PC1-","PC2+", "PC2-","PC3+", "PC3-").

mag

numeric: magnification parameter for the illustrated deformation

heat

logical: if TRUE the heatmap is used. Heatmap is computed by calculating the log(determinant) of Jacobian matrix calculated using the first derivative of Thin Plate Spline function.

mfrow

numeric vector: "mfrow" argument in par() tipically this default serves to display meaningfully positive and negative extremes of ordination scores

mar

numeric vector: "mar" argument in par()

mai

numeric vector: "mai" argument in par()

oma

numeric vector: "oma" argument in par()

colors

numeric: color palette for heatmap

alpha

numeric: transparency parameter for heatmpa color

magrange

numeric: zoom parameter for subplots. When this parameter is smaller the subplot is bigger.

exts

numeric vector: "ext" parameter in tpsgrid() function from "shapes" package

PB

numeric vector: "PB" argument from pslg() function in RTriangle package.

PA

matrix: "PA" argument from pslg() function in RTriangle package.

S

matrix: "S" argument from pslg() function in RTriangle package.

SB

numeric vector: "SB" argument from pslg() function in RTriangle package.

H

matrix: "H" argument from pslg() function in RTriangle package.

V

numeric: "V" argument from triangulate() function in RTriangle package.

a

numeric: "a" argument from triangulate() function in RTriangle package.

q

numeric: "q" argument from triangulate() function in RTriangle package.

Y

logical: "Y" argument from triangulate() function in RTriangle package.

j

logical: "j" argument from triangulate() function in RTriangle package.

D

logical: "D" argument from triangulate() function in RTriangle package.

St

numeric: "S" argument from triangulate() function in RTriangle package.

Q

logical: "Q" argument from triangulate() function in RTriangle package.

constr

logical: if TRUE a constrained triangulation according to links is performed

pholes

list: an optional list of vectors indicating points identifying holes in the input geoemtries

Author(s)

Paolo Piras

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run:  
data(macrogroup)
data(my2d)
linksdors<-list(c(1,2),c(37,7),c(12,4),c(27,28),c(25,21),c(38,40),c(9,10),c(2,3),c(3,4),c(1,7),c(1,6),c(3,5),c(6,40),c(5,9),c(40,8),c(8,9),c(1,7),c(7,6),c(3,4),c(4,5),c(39,38),c(38,35),c(35,37),c(37,39),c(35,34),c(34,33),c(33,32),c(32,31),c(31,30),c(30,29),c(29,37),c(37,36),c(36,29),c(28,31),c(28,30),c(13,10),c(10,11),c(11,12),c(12,13),c(13,14),c(14,16),c(16,17),c(17,20),c(20,19),c(19,18),c(18,12),c(18,15),c(15,12),c(21,19),c(21,20),c(24,25),c(25,26),c(26,27),c(27,24),c(26,24),c(24,23),c(23,22),c(22,8),c(8,2))                                                                                                                                                           
amy2d<-procSym(my2d,CSinit=T,scale=F)
plot(amy2d$PCscores[,1:2],asp=1)
plotdefo(amy2d,linkss=linksdors,linkst=linksdors)
orbitR<-centroids(amy2d$mshape[c(18,19,20,17,16,14,13,12,15),])
orbitL<-centroids(amy2d$mshape[c(37,35,34,33,32,31,30,29,36),])
plotdefo(amy2d,linkss=linksdors,linkst=linksdors,H=rbind(orbitR,orbitL),pholes=list(c(18,19,20,17,16,14,13,12,15),c(37,35,34,33,32,31,30,29,36)))

## End(Not run)

deformetrics/deformetrics documentation built on May 15, 2019, 3:20 a.m.