ELAplus-package: Energy Landscape Analysis for Ecological Communities

ELAplus-packageR Documentation

Energy Landscape Analysis for Ecological Communities

Description

Energy landscape analysis (ELA) is a systematic method for analyzing an energy landscape represented as a weighted network. This R package is especially designed to analyze ecological dynamics, i.e., transitions in community compositions. For details of the analysis framework, please visit Suzuki K et al. (2021) <doi:10.1002/ecm.1469>.

Details

This package provides tools for energy landscape analysis (ELA), a framework for analyzing dynamical systems represented as weighted networks. The main functions support construction of energy landscapes, by fitting the community composition data to a pairwise maximum entropy model (or its extension) and subsequent identification of stable states, and analysis of transitions between community compositions.

Author(s)

Kenta Suzuki [aut, cre, cph], Sotaro Takano [aut], Hiroaki Fujita [aut], Zeus Sato [ctb], Fumihiko Ayabe [ctb]

Maintainer: Kenta Suzuki <kenta.suzuki.zk@riken.jp>

References

Suzuki, K., Nakaoka, S., Fukuda, S., & Masuya, H. (2021). "Energy landscape analysis elucidates the multistability of ecological communities across environmental gradients." Ecological Monographs. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/ecm.1469")} https://esajournals.onlinelibrary.wiley.com/doi/abs/10.1002/ecm.1469

See Also

GitHub: https://github.com/kecosz/rELA, Portal: https://elaportal.org

Examples

# load sample dataset
data("baseabtable")
data("basemetadata")
# Formatting dataset
formatted <- Formatting(baseabtable, basemetadata, 0, c(0.05, 0.05, 0.95))
ocvecs <- formatted[[1]]
envecs <- formatted[[3]]
# Example (without environmental parameters)
# Fitting the data to the extended maximum pairwise entropy model
# without explicit environmental parameters
sa <- runSA(
  ocvecs,
  enmat   = NULL,
  rep     = 1,
  getall  = FALSE,
  lambda  = 0.01,
  we      = 0.001,
  maxlr = 0.005,
  totalit = 1000
)

# Using the fitted model, normal ELA is run.
ela <- ELA(sa, env=NULL,
           threads=1,SS.itr=2000,
           FindingTip.itr=1000,
           reporting=TRUE)
# Pruning stable states
elap <- ELPruning(ela, th=0.1)
# show disconnectivity graph
showDG(elap[[1]], ocvecs, "test")
# show species interaction graph
showIntrGraph(elap[[1]], sa, th=0.01,
              annot_adj=c(0.75, 2.00))
              
# Example (with environmental parameters)   
# Find best parameter sets for the machine learning (with envecs)

bpresult <- Findbp(ocvecs,enmat=envecs,rep=1,threads=1,nrepeat=1,cvmode="5fold")
bp <- bpresult[[1]]
bpm <- as.numeric(unlist(strsplit(names(bp)[1], split = "_")))
# Fitting the data to the extended maximum pairwise entropy model
# with explicit environmental parameters
sa <- runSA(
  ocvecs,
  enmat   = envecs,
  rep     = 16,
  getall  = FALSE,
  lambda  = bpm[[1]],
  we      = bpm[[2]],
  maxlr = bpm[[3]],
  totalit = bpm[[4]]
)
# Using the fitted model, gradient ELA is run.
gela <- GradELA(
  sa      = sa,
  eid     = "factor.1",
  enmat   = envecs,
  env     = NULL,
  range   = c(0, 1),
  steps   = 32,
  th      = 0.05,
  threads = 2
)
showSSD(gela)


ELAplus documentation built on May 28, 2026, 5:09 p.m.