# [R] heat color on age visible on ordination

Jim Lemon drjimlemon at gmail.com
Tue May 24 04:08:43 CEST 2016

```Hi Jackson,
One way to assign colors to values is:

library(plotrix)
ages<-seq(1, 50000, by = 100)
agecol<-color.scale(ages,extremes=c("purple","red"))

Then just use "agecol" for your point colors.

Jim

On Tue, May 24, 2016 at 11:57 AM, Jackson Rodrigues
<jacksonmrodrigues at gmail.com> wrote:
> Hi everybody,
>
> I have a big matrix spread over a long time period.
> I would like to make a ordination plot (PCA, CA, DCA etc) of this matrix
> and look for patterns on time by exploring a color scheme (I have heat
> color in mind).
> The idea is to use a progressive color scheme ranging from red (the oldest
> age) until purple (the youngest one). Then, make a ordination and see if
> the similar colors are plotted together, if so , I would have a pattern on
> time easily identifiable on 2 dimensions.
>
> Let me give an hypothetical case to you.
>
> mat5 <- matrix(rnorm(2000), ,4) #I have a matrix
> mat5
> seq<-seq(1, 50000, by = 100) # I have a time sequence of 500 dates ranging
> from 50000 to 1
> seq
>
> rownames(mat5) <- c(seq ) # making ages the row names of the matrix
>
> library("vegan")
> test.pca<-rda(mat5) # Ordination (PCA)
>
> plot(test.pca, scaling=-3) # In this plot I would like to have the old ages
> ranging from red (age 50000) to purple (age 1)
>
> Would that be possible??
>
> Thank you all for any help
>
> Jackson M. Rodrigues
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help