shipshape
The package consists of two main functions: shape_proc_distance
for calculating Procrustes distance metrics, and shape_elastic_distance
for calculating Elastic distance metrics.
To install the latest version directly from Github, please use:
devtools::install_github("goutham1220/shipshape")
In order to use the shape_proc_distance
and shape_elastic_distance
functions, your data should be contained in a 3-dimensional array.
Each object should occupy a separate page of the array, like so:
, , 1
[,1] [,2]
[1,] 1 13
[2,] 2 14
[3,] 3 15
, , 2
[,1] [,2]
[1,] 4 16
[2,] 5 17
[3,] 6 18
, , 3
[,1] [,2]
[1,] 7 19
[2,] 8 20
[3,] 9 21
If your data is not formatted like this, use the data_split
function to automatically convert your data into a 3D array like so:
data_split(test_data, 100)
With this in mind, if your data was contained in a 3D array arr
, the functions can be called like this:
shape_proc_distance(arr, type = "full")
shape_elastic_distance(arr, mode = "C")
The functions will then calculate all nC2 combinations of distances and return the distances, properly labeled, as a vector, like so:
1 2 1 3 2 3
0.1974612 0.3008154 0.3186260
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.