Description Usage Arguments Value Author(s) Examples
View source: R/arrangeColors.R
For Given N Colors, to the biggest groups in the groupSizes Table the colors are selected in order the remaining groups are getting the defaultColors
1 | arrangeColors(colorVector, groupSizes, defaultColor = "lightgrey")
|
colorVector |
The Colors as a string vector like c("red", "blue") sort(table(mapAuthorToDOI(wckarate)[,1]),decreasing = TRUE)) |
groupSizes |
The Result of a sorted Table of wckrate sort(table(mapAuthorToDOI(wckarate)[,1]),decreasing = TRUE) |
defaultColor |
The defaultColors for the remaining Groups Default is "lightgrey" |
A vector with elements same as the groups existing
MFinst
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (colorVector, groupSizes, defaultColor = "lightgrey")
{
N = length(colorVector)
result = replicate(length(groupSizes), defaultColor)
for (i in 1:N) {
result[as.numeric(names(groupSizes)[i])] = colorVector[i]
}
return(result)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.