arrangeColors: Arrange Colors

Description Usage Arguments Value Author(s) Examples

View source: R/arrangeColors.R

Description

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

Usage

1
arrangeColors(colorVector, groupSizes, defaultColor = "lightgrey")

Arguments

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"

Value

A vector with elements same as the groups existing

Author(s)

MFinst

Examples

 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)
  }

mfinst/TM-CoCit-Support-FM documentation built on March 4, 2020, 8:38 p.m.