-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathREADME.Rmd
executable file
·142 lines (107 loc) · 5.29 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
---
output:
github_document:
html_preview: false
---
<!--README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
## Momocs
<!--Badges -->
[](https://www.tidyverse.org/lifecycle/#stable)
[](https://github.com/MomX/Momocs/actions/workflows/R-CMD-check.yaml)
[](http://cran.r-project.org/package=Momocs)
[](https://codecov.io/github/MomX/Momocs?branch=master)
 
<!-- badges: start -->
<!-- badges: end -->
### News
* I'm still looking for funding to develop MomX. If you have any idea, please email me `<[email protected]>`
* I'm available for consulting, training and collaboration, worldwide.
* Momocs is back on CRAN and no longer relies on the retired `rgeos` dependency
* The tutorial/introduction is back! Download it [there](https://github.com/MomX/Momocs/releases/download/v1.4.0/Momocs_intro.html)**
### Installation
The last released version can be installed from [CRAN](https://CRAN.R-project.org/package=Momocs ) with:
```{r cran-installation, eval = FALSE}
install.packages("Momocs")
```
But I recommend using (and only support) the development version from GitHub with:
```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("MomX/Momocs")
```
<!--
## Features
__Matrices of xy-coordinates__
* ~100 generic tools like centering, scaling, rotating, calculating area, perimeter, etc. Full list with `apropos("coo_")`
* generic plotters: `coo_plot` and `g` (work in progress)
__Data acquisition + Babel__
* Outline extraction from black mask/silhouettes `.jpgs`
* Landmark definition on outlines (`def_ldk` or via [StereoMorph](https://github.com/aaronolsen/StereoMorph))
* Open curves digitization with bezier curves (via [StereoMorph](https://github.com/aaronolsen/StereoMorph))
* Import/Export from/to `.nts`, `.tps`, `PAST`, `.txt`, etc.
__Outline analysis__
* Elliptical Fourier analysis (`efourier`)
* Radii variation (`rfourier`)
* Radii variation - curvilinear abscissa (`sfourier`)
* Tangent Angle Fourier analysis (`tfourier`)
__Open-outlines__
* Natural (raw) polynomials (`npoly`)
* Orthogonal (Legendre) polynomials (`opoly`)
* Discrete Cosinus Transform (`dfourier`)
* `bezier` core functions
__Configuration of landmarks__
* Full Generalized Procrustes Adjustment (`fgProcrustes`)
* Sliding semi-landmarks (`fgsProcrustes`)
__Traditional morphometrics and global shape descriptors__
* Facilities for multivariate analysis (see `flowers`)
* A long list of shape scalars (eg. `coo_eccentricity`, `coo_rectilinearity`, etc.)
__Data handling__
* Easy data manipulation with `filter`, `select`, `slice`, `mutate` and other verbs ala [dplyr](https://github.com/hadley/dplyr/)
* New verbs useful for morphometrics such as `combine` and `chop`, to handle several 2D views
* Permutation methods to resample data (`perm`, `breed`)
__Multivariate analysis__
* Mean shape (groupwise) calculations (`mshapes`)
* Principal component analysis (`PCA`)
* Multivariate analysis of variance (`MANOVA` + pairwise testing `MANOVA_PW`)
* Linear discriminant analysis and screening (`LDA`)
* Hierarchical clustering (`CLUST`)
* K-means (`KMEANS`)
__Graphical methods__
* Family pictures and quick inspection of whole datasets (`stack` and `panel`)
* Some `ggplot2` plots, when useful (and convet Momocs' objects into `data.frames it with `as_df`)
* Morphological spaces for PCA
* Thin plate splines and variation around deformation grids
__Misc__
* Datasets for all types of data (`apodemus`, `bot`, `chaff`, `charring`, `flower`, `hearts`, `molars`, `mosquito`, `mouse`, `oak`, `olea`, `shapes`, `trilo`, `wings`)
* [Shiny](http://shiny.rstudio.com/) demonstrators/helpers. See [Momecs](https://github.com/vbonhomme/Momecs/)
* [Online documentation](http://vbonhomme.github.io/Momocs/)
-->
### Example
This is a basic example of a complete analysis doing: inspection, normalization of raw outlines, elliptical Fourier transforms, dimmensionality reduction and classification, using a single line.
```{r, eval=FALSE}
library(Momocs)
```
```{r}
devtools::load_all()
```
```{r, echo=FALSE}
options(Momocs_verbose = FALSE)
```
```{r example, message=FALSE, message=FALSE}
hearts %T>% # A toy dataset
stack() %>% # Take a family picture of raw outlines
fgProcrustes() %>% # Full generalized Procrustes alignment
coo_slide(ldk = 2) %T>% # Redefine a robust 1st point between the cheeks
stack() %>% # Another picture of aligned outlines
efourier(6, norm=FALSE) %>% # Elliptical Fourier Transforms
PCA() %T>% # Principal Component Analysis
plot_PCA(~aut) %>% # A PC1:2 plot
LDA(~aut) %>% # Linear Discriminant Analysis
plot_CV() # And the confusion matrix after leave one out cross validation
```