Skip to contents

Morphometrics methods

efourier() efourier_norm()
Elliptical Fourier transform (and its normalization)
rfourier()
Radii variation Fourier transform (equally spaced radii)
tfourier()
Tangent angle Fourier transform
sfourier()
Radii variation Fourier transform (equally spaced curvilinear abscissa)
dfourier()
Discrete cosinus transform
opoly()
Calculate orthogonal polynomial fits on open outlines
npoly()
Calculate natural polynomial fits on open outlines
fgProcrustes()
Full Generalized Procrustes alignment between shapes
fgsProcrustes()
Full Generalized Procrustes alignment between shapes with sliding landmarks
bezier()
Calculates Bezier coefficients from a shape

More morphometrics methods

Inverse functions and some others internally used by the main ones

efourier_i()
Inverse elliptical Fourier transform
rfourier_i()
Inverse radii variation Fourier transform
tfourier_i()
Inverse tangent angle Fourier transform
sfourier_i()
Inverse radii variation Fourier transform
dfourier_i()
Investe discrete cosinus transform
opoly_i() npoly_i()
Calculates shape from a polynomial model
bezier_i()
Calculates a shape from Bezier coefficients
fProcrustes()
Full Procrustes alignment between two shapes
pProcrustes()
Partial Procrustes alignment between two shapes

Calibration and other helpers for (open or not) outlines

When defined

calibrate_deviations() calibrate_deviations_efourier() calibrate_deviations_tfourier() calibrate_deviations_rfourier() calibrate_deviations_sfourier() calibrate_deviations_npoly() calibrate_deviations_opoly() calibrate_deviations_dfourier()
Quantitative calibration, through deviations, for Out and Opn objects
calibrate_harmonicpower() calibrate_harmonicpower_efourier() calibrate_harmonicpower_rfourier() calibrate_harmonicpower_tfourier() calibrate_harmonicpower_sfourier() calibrate_harmonicpower_dfourier()
Quantitative calibration, through harmonic power, for Out and Opn objects
calibrate_reconstructions_efourier() calibrate_reconstructions_rfourier() calibrate_reconstructions_tfourier() calibrate_reconstructions_sfourier() calibrate_reconstructions_npoly() calibrate_reconstructions_opoly() calibrate_reconstructions_dfourier()
Calibrate using reconstructed shapes
calibrate_r2() calibrate_r2_opoly() calibrate_r2_npoly()
Quantitative r2 calibration for Opn objects
harm_pow()
Calculates harmonic power given a list from e/t/rfourier
hcontrib()
Harmonic contribution to shape
coeff_rearrange()
Rearrange a matrix of (typically Fourier) coefficients
coeff_sel()
Helps to select a given number of harmonics from a numerical vector.
coeff_split()
Converts a numerical description of harmonic coefficients to a named list.
rm_asym() rm_sym()
Removes asymmetric and symmetric variation on OutCoe objects
symmetry()
Calcuates symmetry indices on OutCoe objects
Ptolemy()
Ptolemaic ellipses and illustration of efourier
morphospace_positions()
Calculates nice positions on a plane for drawing shapes

Classes

Their description and rationale

Coo()
Coo "super" class
Out()
Builds an Out object
Opn()
Builds an Opn object
Ldk()
Builds an Ldk object
Coe()
Coe "super" class
OutCoe()
Builds an OutCoe object
OpnCoe()
Builds an OpnCoe object
TraCoe()
Traditional morphometrics class
is_Coo() is_PCA() is_LDA() is_Out() is_Opn() is_Ldk() is_Coe() is_OutCoe() is_OpnCoe() is_LdkCoe() is_TraCoe() is_shp() is_fac() is_ldk() is_slidings() is_links()
Class and component testers

Classes manipulation

Largely inspired from dplyr’s verbs

arrange()
Arrange rows by variables
at_least()
Retain groups with at least n shapes
chop()
Split to several objects based on a factor
combine()
Combine several objects
dissolve()
Dissolve Coe objects
filter()
Subset based on conditions
mutate()
Add new variables
rescale()
Rescale coordinates from pixels to real length units
rename()
Rename columns by name
select()
Select columns by name
rm_harm()
Removes harmonics from Coe objects
rm_uncomplete()
Remove shapes with incomplete slices
rm_missing()
Remove shapes with missing data in fac
rw_fac()
Renames levels on Momocs objects
sample_frac()
Sample a fraction of shapes
sample_n()
Sample n shapes
slice()
Subset based on positions
subsetize()
Subsetize various Momocs objects
verify()
Validates Coo objects

Import/Export

Will be all moved to Momit soon

export()
Exports Coe objects and shapes
as_df()
Turn Momocs objects into tydy data_frames
import_Conte()
Extract outlines coordinates from an image silhouette
import_jpg()
Extract outline coordinates from multiple .jpg files
import_jpg1()
Extract outline coordinates from a single .jpg file
import_StereoMorph_curve1() import_StereoMorph_curve() import_StereoMorph_ldk1() import_StereoMorph_ldk()
Import files creates by StereoMorph into Momocs
import_tps() tps2coo()
Import a tps file
import_txt()
Import coordinates from a .txt file
tie_jpg_txt()
Binds .jpg outlines from .txt landmarks taken on them
img_plot() img_plot0()
Plots a .jpg image
lf_structure()
bind_db.Coe <- bind_db.Coo Extracts structure from filenames
pix2chc() chc2pix()
Convert (x; y) coordinates to chaincoded coordinates

Multivariate methods

Will be in Momecs at some point, and with KMEDOIDS, SVM, NNET and QDA

PCA() as_PCA()
Principal component analysis on Coe objects
LDA()
Linear Discriminant Analysis on Coe objects
MSHAPES()
Mean shape calculation for Coo, Coe, etc.
MANOVA()
Multivariate analysis of (co)variance on Coe objects
MANOVA_PW()
Pairwise Multivariate analyses of variance
KMEANS()
KMEANS on PCA objects
KMEDOIDS()
KMEDOIDS
MDS()
(Metric) multidimensional scaling
NMDS()
Non metric multidimensional scaling
CLUST()
Hierarchical clustering

More on multivariate

Will be in Momecs at some point

PCcontrib()
Shape variation along PC axes
flip_PCaxes()
Flips PCA axes
scree() scree_min() scree_plot()
How many axes to retain this much of variance or trace ?
rePCA()
"Redo" a PCA on a new Coe
reLDA()
"Redo" a LDA on new data
classification_metrics()
Calculate classification metrics on a confusion matrix
which_out()
Identify outliers
plot(<LDA>)
Plots Linear Discriminant Analysis
plot(<PCA>)
Plots Principal Component Analysis
boxplot(<OutCoe>)
Boxplot of morphometric coefficients
boxplot(<PCA>)
Boxplot on PCA objects

Graphics

Because who does not love graphics?

panel()
Family picture of shapes
mosaic_engine() mosaic()
Plots mosaics of shapes.
pile()
Graphical pile of shapes
stack(<Coo>) stack(<Ldk>)
Family picture of shapes
inspect()
Graphical inspection of shapes
plot_CV()
Plots a cross-validation table as an heatmap
plot_CV2()
Plots a cross-correlation table
plot_LDA()
LDA plot using grindr layers
plot_MSHAPES()
Pairwise comparison of a list of shapes
plot_NMDS() plot_MDS()
NMDS plot unsing grindr layers
plot_PCA()
PCA plot using grindr layers
plot_devsegments()
Draws colored segments from a matrix of coordinates.
plot_silhouette()
Silhouette plot
plot_table()
Plots confusion matrix of sample sizes within $fac
tps2d() tps_apply()
Thin Plate Splines for 2D data
tps_arr()
Deformation 'vector field' using Thin Plate Splines
tps_grid()
Deformation grids using Thin Plate Splines
tps_iso()
Deformation isolines using Thin Plate Splines.
tps_raw()
Vanilla Thin Plate Splines

grindr Graphics

(base) graphics is not dead!

Bridges

Convert between different classes

l2m() m2l() d2m() m2d() l2a() a2l() a2m() m2a() m2ll()
Convert between different classes

Landmark helpers

add_ldk()
Adds new landmarks on Out and Opn objects
coo_plot() ldk_plot()
Plots a single shape
ldk_check()
Checks 'ldk' shapes
ldk_chull()
Draws convex hulls around landmark positions
ldk_confell()
Draws confidence ellipses for landmark positions
ldk_contour()
Draws kernel density contours around landmark
ldk_labels()
Add landmarks labels
ldk_links()
Draws links between landmarks
def_ldk()
Defines new landmarks on Out and Opn objects
def_ldk_angle() def_ldk_direction()
Add new landmarks based on angular positions
def_ldk_tips()
Define tips as new landmarks
def_links()
Defines links between landmarks
def_slidings()
Defines sliding landmarks matrix
links_all()
Creates links (all pairwise combinations) between landmarks
links_delaunay()
Creates links (Delaunay triangulation) between landmarks
d()
A wrapper to calculates euclidean distances between two points
measure()
Measures shape descriptors
coo_truss()
Truss measurement
slidings_scheme()
Extracts partitions of sliding coordinates
rearrange_ldk()
Rearrange, (select and reorder) landmarks to retain

Getters/Setters for components of interest

get_chull_area() get_chull_volume()
Calculates convex hull area/volume of PCA scores
get_ldk()
Retrieves landmarks coordinates
get_pairs()
Get paired individual on a Coe, PCA or LDA objects
get_slidings()
Extracts sliding landmarks coordinates

Data

To play around with various data types

apodemus
Data: Outline coordinates of Apodemus (wood mouse) mandibles
bot
Data: Outline coordinates of beer and whisky bottles.
chaff
Data: Landmark and semilandmark coordinates on cereal glumes
charring
Data: Outline coordinates from an experimental charring on cereal grains
flower
Data: Measurement of iris flowers
hearts
Data: Outline coordinates of hand-drawn hearts
molars
Data: Outline coordinates of 360 molars
mosquito
Data: Outline coordinates of mosquito wings.
mouse
Data: Outline coordinates of mouse molars
nsfishes
Data: Outline coordinates of North Sea fishes
oak
Data: Configuration of landmarks of oak leaves
olea
Data: Outline coordinates of olive seeds open outlines.
shapes
Data: Outline coordinates of various shapes
trilo
Data: Outline coordinates of cephalic outlines of trilobite
wings
Data: Landmarks coordinates of mosquito wings

Farming shapes

Most of them will move to Momfarm soon

dfourier_shape()
Calculates and draws 'dfourier' shapes
efourier_shape()
Calculates and draw 'efourier' shapes.
rfourier_shape()
Calculates and draw 'rfourier' shapes.
sfourier_shape()
Calculates and draw 'sfourier' shapes.
tfourier_shape()
Calculates and draws 'tfourier' shapes.
breed()
Jitters Coe (and others) objects
perm()
Permutes and breed Coe (and others) objects

Color palettes

Qualitative, diverging and sequential, all those colorblind friendly from RColorBrewer, viridis and more.

Misc

Momocs-package Momocs
Momocs
cpx2coo() coo2cpx()
Convert complex to/from cartesian coordinates
ed()
Calculates euclidean distance between two points.
edm()
Calculates euclidean distance every pairs of points in two matrices.
edm_nearest()
Calculates the shortest euclidean distance found for every point of one matrix among those of a second.
edi()
Calculates euclidean intermediate between two points.
is_equallyspacedradii()
Tests if coordinates likely have equally spaced radii
fac_dispatcher()
Brew and serve fac from Momocs object

coo_ toolbox

circa 100 helpers for 2D shapes and Coo objects

coo_align()
Aligns coordinates
coo_aligncalliper()
Aligns shapes along their 'calliper length'
coo_alignminradius()
Aligns shapes using their shortest radius
coo_alignxax()
Aligns shapes along the x-axis
coo_angle_edges()
Calculates the angle of every edge of a shape
coo_angle_tangent() coo_tangle()
Calculates the tangent angle along the perimeter of a shape
coo_area()
Calculates the area of a shape
coo_arrows()
Plots (lollipop) differences between two configurations
coo_baseline()
Register new baselines
coo_bookstein()
Register Bookstein's coordinates
coo_boundingbox()
Calculates coordinates of the bounding box
coo_calliper()
Calculates the calliper length
coo_centdist()
Returns the distance between everypoints and the centroid
coo_center() coo_centre()
Centers coordinates
coo_centpos()
Calculate centroid coordinates
coo_centsize()
Calculates centroid size
coo_check()
Checks shapes
coo_chull() coo_chull_onion()
Calculates the (recursive) convex hull of a shape
coo_circularity() coo_circularityharalick() coo_circularitynorm()
Calculates the Haralick's circularity of a shape
coo_close() coo_unclose()
Closes/uncloses shapes
coo_convexity()
Calculates the convexity of a shape
coo_down()
coo_down Retains coordinates with negative y-coordinates
coo_draw()
Adds a shape to the current plot
coo_draw_rads()
Draw radii to the current plot
coo_dxy()
Calculate abscissa and ordinate on a shape
coo_eccentricityeigen() coo_eccentricityboundingbox()
Calculates the eccentricity of a shape
coo_elongation()
Calculates the elongation of a shape
coo_extract()
Extract coordinates from a shape
coo_flipx() coo_flipy()
Flips shapes
coo_force2close()
Forces shapes to close
coo_interpolate()
Interpolates coordinates
coo_intersect_angle() coo_intersect_direction()
Nearest intersection between a shape and a segment specified with an angle
coo_intersect_segment()
Nearest intersection between a shape and a segment
coo_is_closed() is_open()
Test if shapes are closed
coo_jitter()
Jitters shapes
coo_ldk()
Defines landmarks interactively
coo_left()
Retains coordinates with negative x-coordinates
coo_length()
Calculates the length of a shape
coo_likely_clockwise() coo_likely_anticlockwise()
Tests if shapes are (likely) developping clockwise or anticlockwise
coo_listpanel()
Plots sets of shapes.
coo_lolli()
Plots (lollipop) differences between two configurations
coo_lw()
Calculates length and width of a shape
coo_nb()
Counts coordinates
coo_oscillo()
Momocs' 'oscilloscope' for Fourier-based approaches
coo_perimpts() coo_perimcum() coo_perim()
Calculates perimeter and variations
coo_plot() ldk_plot()
Plots a single shape
coo_range() coo_range_enlarge() coo_diffrange()
Calculate coordinates range
coo_rectangularity()
Calculates the rectangularity of a shape
coo_rectilinearity()
Calculates the rectilinearity of a shape
coo_rev()
Reverses coordinates
coo_right()
Retains coordinates with positive x-coordinates
coo_rotate()
Rotates coordinates
coo_rotatecenter()
Rotates shapes with a custom center
coo_ruban()
Plots differences as (colored) segments aka a ruban
coo_sample()
Sample coordinates (among points)
coo_sample_prop()
Sample a proportion of coordinates (among points)
coo_samplerr()
Samples coordinates (regular radius)
coo_scalars()
Calculates all scalar descriptors of shape
coo_scale() coo_scalex() coo_scaley()
Scales coordinates
coo_shearx() coo_sheary()
Shears shapes
coo_slice()
Slices shapes between successive coordinates
coo_slide()
Slides coordinates
coo_slidedirection()
Slides coordinates in a particular direction
coo_slidegap()
Slides coordinates using the widest gap
coo_smooth()
Smoothes coordinates
coo_smoothcurve()
Smoothes coordinates on curves
coo_solidity()
Calculates the solidity of a shape
coo_tac()
Calculates the total absolute curvature of a shape
coo_template() coo_template_relatively()
'Templates' shapes
coo_trans()
Translates coordinates
coo_trim()
Trims both ends coordinates from shape
coo_trimbottom()
Trims bottom coordinates from shape
coo_trimtop()
Trims top coordinates from shape
coo_truss()
Truss measurement
coo_untiltx()
Removes rotation so that the centroid and a given point are parallel to the x-axis
coo_up()
Retains coordinates with positive y-coordinates
coo_width()
Calculates the width of a shape