morph_nds_compar: Morphometrics comparisons between GUs

View source: R/morph_nds_compar.R

morph_nds_comparR Documentation

Morphometrics comparisons between GUs

Description

Momocs package morphometrics comparisons between different graphical units (GUs). Read JPG files from each different folder. This function is used after converting the geometries to JPG using 'conv_wkt_to_jpg()'. This function is useful before grouping (see, 'morph_nds_group' function) to determine the number of clusters.

Usage

morph_nds_compar(
  nodes = NA,
  ids = c("site", "decor", "id"),
  focus = c("all"),
  nb.h = 15,
  stack.norm = "normalized",
  colored = TRUE,
  cex = 1,
  lwd = 1,
  dataDir = system.file("extdata", package = "iconr"),
  out.dir = "_out",
  verbose = TRUE
)

Arguments

nodes

Dataframe of nodes.

ids

the field names that constitute the unique key of the GU. By default: c("site", "decor", "id").

focus

Type of analysis: 'panel', 'stack', 'PCA' (Pricnipal Component Analysis), 'clust' (hierachical clustering, 'dist' (distance matrix) or 'all'. The option 'dist' allows the calculation of the distance matrix which can be used in 'morph_aggregate()'. By default 'all'.

nb.h

Number of Fourier harmonics, uniquely for PCA. By default = 15.

stack.norm

For the Momocs stack, whether if the GU have to be "normalized" (i.e. centered and scaled), "centered", "scaled", "not centered nor scaled". By default "normalized".

colored

if TRUE (by default), will color on 'ids' (unique identifiants/keys).

cex

Size of the text, by default 1.

lwd

Width of the dendrogram branches, by defaul 1.

dataDir

Path to the folder.

out.dir

Name of output folder.

verbose

if TRUE (by default), verbose.

Value

Depending on the focus, return 'panel', 'stack' or 'PCA' plots with their complete path

Examples


dataDir <- system.file("extdata", package = "iconr")
nd.df.path <- conv_shp_to_wkt(dataDir = dataDir)
nodes <- read.csv(nd.df.path, sep = ";")
conv_wkt_to_jpg(nodes = nodes)

# create PNG with panels
morph_nds_compar(nodes, focus = c("panel"))

## [1] "* read 'oeil' type of UGs"
## Extracting 10.jpg outlines...
## [ 1 / 10 ]  Ain Ghazal.stat_2.1.jpg
## ...
## [ 10 / 10 ]  Qarassa.figurine__wx.14.jpg

# Distance matrices
ldist <- morph_nds_compar(nodes, focus = c("dist"))


zoometh/iconr documentation built on Nov. 9, 2023, 10:01 a.m.