earlywarnings vignette

earlywarnings R package

Installation

Installing and loading the release version

install.packages("earlywarnings")

Installing and loading the experimental development version

library(devtools)
install_github("earlywarningtoolbox/earlywarnings-R/earlywarnings")

Clone the repository & install locally:

Run on command line:

git clone git@github.com:earlywarningtoolbox/earlywarnings-R.git
./build.sh

Loading the package

library(earlywarnings)  

Potential analysis

Potential analysis, used for instance in [Hirota et al. Science, 2011, 334, 232-235.]

# Create simulated example data
X <- c(rnorm(1000, mean = 0), rnorm(1000, mean = -2), 
               rnorm(1000, mean = 2))
param <- seq(0,5,length=3000) 

# Run potential analysis
res <- movpotential_ews(X, param)

# Visualize
p <- PlotPotential(res$res, title = '', 
               xlab.text = '', ylab.text = '', 
           cutoff = 0.5, plot.contours = TRUE, binwidth = 0.2)
print(p)

Licensing and Citations

This work can be freely used, modified and distributed under the Two-clause (Free)BSD license.

Kindly cite the work as 'Vasilis Dakos and Leo Lahti (2014). earlywarnings R package. URL: https://github.com/earlywarningtoolbox/earlywarnings-R'.

citation("earlywarnings")

Session info

This vignette was created with

sessionInfo()


Try the earlywarnings package in your browser

Any scripts or data that you put into this service are public.

earlywarnings documentation built on Oct. 11, 2022, 1:05 a.m.