# Analysis of community ecology data in R

David Zelený

### Site Tools

en:tbpca_examples

# Differences

This shows you the differences between two versions of the page.

 en:tbpca_examples [2018/03/28 23:20]David Zelený created en:tbpca_examples [2018/03/28 23:21]David Zelený 2018/03/28 23:21 David Zelený 2018/03/28 23:20 David Zelený created2018/03/28 23:20 David Zelený created Next revision Previous revision 2018/03/28 23:21 David Zelený 2018/03/28 23:20 David Zelený created2018/03/28 23:20 David Zelený created Line 4: Line 4: [[{|width: 7em; background-color:​ white; color: navy}tbpca|Theory]] [[{|width: 7em; background-color:​ white; color: navy}tbpca|Theory]] [[{|width: 7em; background-color:​ white; color: navy}tbpca_R|R functions]] [[{|width: 7em; background-color:​ white; color: navy}tbpca_R|R functions]] - [[{|width: 7em; background-color: ​white; color: ​navy}tbpca_examples|Examples]] + [[{|width: 7em; background-color: ​light; color: ​firebrick}tbpca_examples|**Examples**]] - [[{|width: 7em; background-color: ​light; color: ​firebrick}tbpca_exercise|**Exercise** {{::​lock-icon.png?​nolink|}}]] + [[{|width: 7em; background-color: ​white; color: ​navy}tbpca_exercise|Exercise {{::​lock-icon.png?​nolink|}}]] + + + ==== Example 1: PCA on species data transformed using Hellinger transformation ==== + In this example we will use vegetation data from [[en:​data:​vltava|Vltava river valley dataset]], and we will analyse them by PCA after pre-transformation by Hellinger transformation. + + ​ + vltava.spe <- read.delim ('​http://​www.davidzeleny.net/​anadat-r/​data-download/​vltava-spe.txt',​ row.names = 1) + vltava.spe.hel <- decostand (log1p (vltava.spe),​ '​hellinger'​) # the species data (percentage scale) are first log transformed,​ and then transformed using Hellinger transformation + + PCA <- rda (vltava.spe.hel) + + source ('​http://​www.davidzeleny.net/​anadat-r/​doku.php/​en:​numecolr:​cleanplot.pca?​do=export_code&​codeblock=0'​) # define the cleanplot.pca function + cleanplot.pca (PCA) + ​ + + {{:​obrazky:​ordination_unc18.png?​900&​direct|}} + + These ordination diagrams do not look too helpful (you need to click to enlarge them to see more details) - but we will see [[en:​indirect_ordination_viz|later]] how to visualize the results of ordination more effectively. +