knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of paleotools is to ...
You can install the development version of the package from GitHub with:
# install.packages("devtools") devtools::install_github("mchevalier2/paleotools")
This is a basic example which shows you how to use the Earth Movers' Distance (EMD) and the associated significance test.
library(paleotools) EMD(1:5/sum(1:5), 6:10/sum(6:10)) EMD(1:5, 6:10) # The vectors are normalised by the function m <- matrix(1:25, ncol=5) for(i in 1:5) m[i,i] <- 0 EMD(1:5, 6:10, weight.m=m)
m1 <- matrix(abs(rnorm(500)), ncol=5) ; m1 <- m1 / apply(m1, 1, sum) m2 <- matrix(abs(rnorm(500)), ncol=5) ; m2 <- m2 / apply(m2, 1, sum) signif_struct(m1, m2, plot=FALSE) res <- signif_struct(m1, m2, plot=TRUE, verbose=TRUE) res <- signif_struct(m1, 1+m1, plot=TRUE, verbose=TRUE, nrep=100) str(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.