Description Usage Arguments Value Examples
p.colorbyvar is a function to create a vector with colors by variation. Recommended to color graphics created with metools p.functions.
1  | p.colorbyvar(x, colorp = "#17B221", colorn = "#B21717", lag = 1)
 | 
x | 
 a numeric vector  | 
colorp | 
 Positive changes color (default=Green)  | 
colorn | 
 Negative changes color (default=Red)  | 
lag | 
 Lag to comparison (default=1)  | 
Return a vector with colors.
1 2 3 4  | v=c(3,2,5,6,5,4)
p.colorbyvar(x=v,colorp="blue",colorn="grey")
barplot(v,col=p.colorbyvar(v))
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.