User Tools

Site Tools


en:tbpca_examples

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:tbpca_examples [2018/03/28 23:20]
David Zelený created
en:tbpca_examples [2018/03/30 23:04] (current)
Line 6: Line 6:
 [[{|width: 7em; background-color:​ light; color: firebrick}tbpca_examples|**Examples**]] [[{|width: 7em; background-color:​ light; color: firebrick}tbpca_examples|**Examples**]]
 [[{|width: 7em; background-color:​ white; color: navy}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.
 +
 +<code rsplus>
 +vltava.spe <- read.delim ('​https://​raw.githubusercontent.com/​zdealveindy/​anadat-r/​master/​data/​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)
 +</​code>​
 +
 +{{:​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. ​
 +
 +
en/tbpca_examples.1522250445.txt.gz · Last modified: 2018/03/28 23:20 by David Zelený