Description Usage Arguments Details Value Author(s) Examples
View source: R/colour.scheme.R
This function is called during network representations to set node colours. If the number of colours defined by user do not match with the number of elements, the algorithm provide a default set of colours.
1 2 3 4 5 | colour.scheme(def=NA, N=NA, colors=c("green2","red","yellow","blue","DarkOrchid1",
"gray51","chocolate","cyan4","saddle brown","aquamarine","chartreuse","chocolate1",
"DarkOrchid3","gray18","gold","DarkOrchid4","green4","gray29", "sienna3","tan1","blue4",
"limegreen","gray73","bisque3","deeppink","red4","OliveDrab4","gray95", "salmon",
"DeepPink4","green yellow","gray4","hot pink","pink2","dark orange","gold3"))
|
def |
a vector containing the set of colours defined by user |
N |
a numeric representing the number of elements to be coloured |
colors |
a vector with default colours to be used if 'def' is different from 'N' |
If the number of elements is higher than the number of colours (35 by default), colours are randomly selected.
a vector of strings representing 'N' colours
A. J. Muñoz-Pajares
1 2 3 4 5 6 7 8 9 | # colour.scheme(def=c("blue","red"),N=4)
# Colors<-colour.scheme(def=c("blue","red"),N=4,colors=c("black","gray33","gray66","orange","red"))
# plot(c(1:4),col=Colors,pch=16)
#
# #Given 10 individuals classified into three groups,
# #this will provide the colour for each individual:
# group<-c(1,1,1,2,2,2,1,2,3,3) # defining groups
# colour.scheme(N=length(unique(group)))[group]
#
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.