• Stars
    star
    109
  • Rank 319,077 (Top 7 %)
  • Language
    R
  • License
    GNU General Publi...
  • Created over 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ggplot-based plots for vegan

ggvegan; ggplot2-based plots for vegan

R build status CRAN version

What is ggvegan?

ggvegan is a package for the R statistical software and environment. It aims to implement ggplot-based versions of the plots produced by the vegan package. Initially, ggvegan will provide fortify and autoplot methods for objects created in vegan, with the aim of providing full replacement plots via autoplot. The fortify methods allow the data contained within objects created by vegan to be converted into a format suitable for use with ggplot directly.

Licence

ggvegan is released under the GNU General Public Licence, version 2.

Development & contributions

ggvegan uses the roxygen2 system to document package functions alongside the code itself.

ggvegan is very much alpha code at the moment. Comments and feedback on the approach taken are welcome, as are code contributions. See Design decisions below for two important areas for consideration

Design decisions

autoplot

The autoplot concept is somewhat poorly defined at the moment --- at least in public. I have taken it to mean that a full ggplot object is returned, which can then be augmented with additional layers and changes to the scales etc. This means that the aesthetics for the scores are hard-coded in the autoplot methods. If you want greater control over these aesthetics, use fortify to return the scores in a suitable format and build the plot up yourself. I hope to include at least one example of this, where applicable, in the help pages for each autoplot method.

fortify

fortify methods are supposed to return a data frame but this is not necessarily the most convenient representation for vegan's ordination objects where several data frames representing the various sets of ordination scores would be more natural. Currently, ggvegan follows the existing fortify convention of returning a single data frame so returns the ordination scores in long format with variables Score indicating the type of score and Label the label/rowname for each score.

Standard ordination methods

From version 0.0-9, I changed the representation of fortified ordination objects. The first two columns will now be Score and Label. The remaining columns will be the requested ordination dimensions, named as per the scores method from vegan. For example, a PCA will have columns named 'PC1', 'PC2', etc. How many and their numbering depending on the axes argument; the default is 1:6. Consequently, the 'dimLables' attribute is no longer necessary.

A further design decision is that ggvegan fortify methods for ordination objects will return all possible sets of scores and the set returned can not be chosen by the user. Instead, the sets of scores to be plotted should be chosen at the autoplot stage.

More specialised objects

The components returned for more specialised objects will typically vary as needed for a sensible, tidy data representation. Such fortify() methods will return suitable components. For example, fortify.prc() returns components Time, Treatment, and Response corresponding to the two-way factors defining the experiment and the regression coefficients on RDA axis 1 respectively.

Status

The following autoplot methods are currently available

  1. autoplot.cca --- for objects of classes "cca" and "capscale"
  2. autoplot.rda --- for objects of class "rda"
  3. autoplot.metaMDS --- for objects of class "metaMDS"
  4. autoplot.prc --- for objects of class "prc"
  5. autoplot.decorana --- for objects of class "decorana" (AKA DCA)
  6. autoplot.prestonfit --- for objects of class "prestonfit"
  7. autoplot.fisherfit --- for objects of class "fisherfit"

The following fortify method are currently available

  1. fortify.cca --- for objects of classes "cca", "rda", and "capscale"
  2. fortify.metaMDS --- for objects of class "metaMDS"
  3. fortify.prc --- for objects of class "prc"
  4. fortify.decorana --- for objects of class "decorana" (AKA DCA)
  5. autoplot.prestonfit --- for objects of class "prestonfit"
  6. autoplot.fisherfit --- for objects of class "fisherfit"

Installation

No binary packages are currently available via CRAN for ggvegan. If you have the correct development tools you can compile the package yourself after downloading the source code from github.

You can install ggvegan directly from GitHub using functions that the remotes package provides. To do this, install remotes from CRAN via

install.packages("remotes")

then run

remotes::install_github("gavinsimpson/ggvegan")

If that doesn't work or you prefer to install from binaries, the R Universe service run by rOpenSci now provides binaries. Instruction on how to install ggvegan from that repository are:

# Enable repository from gavinsimpson
options(repos = c(
  gavinsimpson = 'https://gavinsimpson.r-universe.dev',
  CRAN = 'https://cloud.r-project.org'))
# Download and install ggvegan in R
install.packages('ggvegan')

More Repositories

1

gratia

ggplot-based graphics and useful functions for GAMs fitted using the mgcv package
R
204
star
2

intro-gam-webinar-2020

HTML
87
star
3

physalia-gam-course

Generalized Additive Models; a data-driven approach to estimating regression models
HTML
73
star
4

intro-vegan-webinar-july-2020

Get started using the vegan package for R for multivariate data analysis and community ecology
HTML
41
star
5

tsgam

Functions for using GAMs to model time series
R
31
star
6

schoenberg

ggplot-based graphics and useful functions for GAMs fitted using the mgcv package
R
26
star
7

gams-yorku-canada-150

GAM Workshop at York University, October 2018
HTML
25
star
8

physalia-multivariate

Multivariate analysis of biological data
HTML
25
star
9

permute

Restricted permutations
R
22
star
10

advanced-vegan-webinar-july-2020

Delve deeper into using R and vegan to analyse complex multivariate community ecology data with this free webinar
HTML
21
star
11

frontiers-palaeo-additive-modelling

Modelling and feature detection in palaeoenvironmental time series using additive models
TeX
20
star
12

esa-advanced-vegan

Advanced Vegan Workshop for ESA
TeX
17
star
13

analogue

Analogue and weighted averaging methods for palaeoecology
R
14
star
14

coenocliner

An R package to simulate species occurences and abundances (counts) along gradients
R
12
star
15

canadaHCD

Access Canadian Historical Climate Data from R
R
10
star
16

ukraine-gam

Workshop on GAMs to support Ukraine
HTML
10
star
17

gams-instaar-2018

Modelling Palaeoenvironmental Time Series Using Generalized Additive Models
HTML
7
star
18

random_code

Random bits of code for my blog
R
6
star
19

esa-advanced-vegan-2016

Advanced Vegan Workshop at ESA 2016
TeX
6
star
20

plant-phys

BIOL 266 Plant Physiology Lab
HTML
5
star
21

fromthebottomoftheheap

My personal blog and wesbite
HTML
5
star
22

au-multivariate-stats

Aarhus university PhD Course Multivariate analysis of biological data using R
HTML
5
star
23

waterloo2022

HTML
4
star
24

temporalEF

Eigenfunctions for time series
R
4
star
25

adelaide-2017

Materials for a course on R for palaeoecologists/limnologists at U Adelaide, 2017
TeX
4
star
26

inqua23

Slides and code for my session keynote at INQUA 2023
R
4
star
27

esa-csee-2022

HTML
4
star
28

au-ecoscience-2023

Seminar at Dept Ecoscience, Aarhus University, March 8th 2023
HTML
4
star
29

virtual-summit-2020

HTML
3
star
30

nso-2022-workshop

Ordination methods for Ecology and Generalized additive models
HTML
3
star
31

esa-advanced-vegan-2015

Materials for an advanced workshop on using vegan in R for conducting community ecology analyses. To be held in Baltimore in 2015 as part of the ESA conference.
TeX
3
star
32

ncse-seminar-2022

National Centre for Statistical Ecology seminar, Feb 9th, 2022
HTML
3
star
33

paleoecogen-seminar-2022

HTML
3
star
34

ecos-water-talk-may-2024

Talk in Aarhus University Department of Ecoscience's Water Talks seminar series, May 2nd, 2024
HTML
3
star
35

au-viborg-gam-course

2
star
36

au-viborg-mixed-modelling-course

2
star
37

hgam-examples

Examples of fitting HGAMs using mgcv
2
star
38

UBCVeganStudyGroup

Materials for UBC Study Group on Vegan and Permute R package
TeX
2
star
39

tracking-virtual-study-hall

HTML
2
star
40

pre-ial-ipa

Live coding session on statistical palaeolimnology
2
star
41

bes-paleo-r-workshop

HTML
2
star
42

palaeopcurvepaper

Use of principal curves for analysis and summary of palaeoecological stratigraphic data
TeX
2
star
43

open-university-seminar-nov-2022

HTML
2
star
44

gavmisc

My package of miscellaneous R functions and code
R
1
star
45

rad-gam

Rank Abundance Diagrams and GAMs
R
1
star
46

orcid

Miscellaneous functions for working with Orcid
1
star
47

pcurve

Glenn De'Ath's principal curve package
R
1
star
48

sdsu-vegan

Vegan workshop at South Dakota State University, March 2016
1
star
49

analogueExtra

Extra features and functions for use with the analogue package
R
1
star
50

ipa-2018-rstats

International Paleolimnology Symposium R Workshop, Stockholm, Sweden, June 15-17, 2018
R
1
star
51

acme-stats

ACME Palaeo data science and statistical modelling workshop
HTML
1
star
52

roxcal

Parse Oxcal output files with R
Makefile
1
star
53

gratia-joss-paper

Manuscript on gratia for the Journal of Open Source Software
TeX
1
star
54

dper5

R code and associated files for my chapters in the book Tracking Environmental Change Using Lake Sediments, Volume 5: Data Handling and Numerical Techniques
R
1
star