ggordiplots

Make ggplot Versions of Vegan's Ordiplots

https://github.com/jfq3/ggordiplots

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.5%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Make ggplot Versions of Vegan's Ordiplots

Basic Info
  • Host: GitHub
  • Owner: jfq3
  • License: gpl-2.0
  • Language: R
  • Default Branch: master
  • Size: 282 KB
Statistics
  • Stars: 7
  • Watchers: 2
  • Forks: 2
  • Open Issues: 0
  • Releases: 1
Created about 9 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# ggordiplots


[![R-CMD-check](https://github.com/jfq3/ggordiplots/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jfq3/ggordiplots/actions/workflows/R-CMD-check.yaml)
[![Github All Releases](https://img.shields.io/github/downloads/jfq3/ggordiplots/total.svg)])


The `vegan` package includes several functions for adding features to ordination plots: `ordiarrows()`,  `ordiellipse()`, `ordihull()`, `ordispider()` and `ordisurf()`. This package adds these same features to ordination plots made with `ggplot2`. In addition, `gg_ordibubble()` sizes points relative to the value of an environmental variable.

The functions are written so that features from each can be combined in customized ordination plots.  

The functions `ord_labels()` and `scale_arrow()` (used to ensure vector arrows fit within a plot) are exported to make it easier to generate custom ordination plots.  

## Installation

You can install the development version of ggordiplots from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("jfq3/ggordiplots")
```
You can install the latest release from CRAN with:  

``` r
install.packages("ggordiplots")
```

## Examples

Plot an ordination with ellipses around treatment group centroids (at distances of one standard deviation) with `gg_ordiplot()`.  

```{r}
library(ggordiplots)
data("dune")
data("dune.env")
dune_bray <- vegdist(dune, method = "bray")
ord <- cmdscale(dune_bray, k = (nrow(dune) - 1), eig = TRUE, add = TRUE)
plt1 <- gg_ordiplot(ord, groups = dune.env$Management, plot = FALSE)
```
`plt1` is list with items named:
```{r}
names(plt1)
```
The first 5 items are data frames for making plots. The last item is a ggplot:  
```{r}
plt1$plot
```
Fit a vector of Al concentrations to the ordination with `gg_envfit()`.  
```{r}
Al <- as.data.frame(dune.env$A1)
colnames(Al) <- "Al"
plt2 <- gg_envfit(ord, env = Al, groups = dune.env$Management, plot = FALSE)
plt2$plot
```
Add ellipses from the first plot to the second plot. The resulting plot can be further customized using usual `ggplot2` methods. For example, change the legend title.  
```{r}
plt2$plot +
  geom_path(data = plt1$df_ellipse, aes(x=x, y=y, color=Group)) +
  guides(color=guide_legend(title="Management")) # Change legend title
  
```

Owner

  • Login: jfq3
  • Kind: user
  • Location: East Lansing, MI, USA
  • Company: Michigan State University

GitHub Events

Total
  • Issues event: 2
  • Issue comment event: 2
  • Push event: 5
Last Year
  • Issues event: 2
  • Issue comment event: 2
  • Push event: 5

Packages

  • Total packages: 2
  • Total downloads:
    • cran 363 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 3
  • Total maintainers: 1
proxy.golang.org: github.com/jfq3/ggordiplots
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 6.9%
Last synced: 10 months ago
cran.r-project.org: ggordiplots

Make 'ggplot2' Versions of Vegan's Ordiplots

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 363 Last month
Rankings
Forks count: 17.4%
Stargazers count: 22.3%
Dependent packages count: 28.4%
Average: 29.9%
Dependent repos count: 36.9%
Downloads: 44.7%
Maintainers (1)
Last synced: 9 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.2.0 depends
  • ggplot2 >= 3.0.0 depends
  • glue * depends
  • vegan >= 2.5 depends
  • formatR * suggests
  • knitr * suggests
  • lattice * suggests
  • permute * suggests
  • rmarkdown * suggests