---
layout: post
title: "Running non-metric multidimensional scaling (NMDS) with in R with vegan and ggplot2 (CC187)"
blurb: "NMDS with R's vegan and ggplot2"
author: "PD Schloss"
date: 2022-02-14 11:00
comments: false
youtube: h7OrVmT7Ja8
start_hash: f1d31bf29443ee4986e16ea045e35946a3e06bf5
end_hash: 8c7acc42584a80bf37a22228ad461547350cb215
---

Non-metric multidimensional scaling (NMDS) is an alternative to principle coordinates analysis (PCoA) and its relative, principle component analysis (PCA). All of these are popular ordination techniques that you can use to reduce the dimensions of data in R. In this episode, Pat Schloss will show how to perform NMDS in R and visualize the ordination in ggplot2. We'll use the metaMDS function from vegan and tools from ggplot2 and the tidyverse packages.


<iframe style="margin: 0 auto;display:block;" width="560" height="315" src="https://www.youtube.com/embed/{{ page.youtube }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>


## Code

You can browse the state of the repository at the
* [beginning of the episode](https://github.com/riffomonas/distances/tree/{{ page.start_hash }})
* [end of the episode](https://github.com/riffomonas/distances/tree/{{ page.end_hash }})
