Assigns colours to integer keys (for example cluster numbers) by cycling
through one or more categorical palettes: key k takes colour
((k - first) mod n) + 1 of the joined palettes.
Usage
PlotDataKeyColours(
keys,
column = "key",
palettes = c("tab20", "tab20b"),
first = 1
)See also
Other plot-data builders:
PlotDataBindRows(),
PlotDataConstant(),
PlotDataCount(),
PlotDataCrossShares(),
PlotDataDirection(),
PlotDataDominant(),
PlotDataFromArrays(),
PlotDataJoin(),
PlotDataLabels(),
PlotDataLonger(),
PlotDataMembership(),
PlotDataPairRatio(),
PlotDataProduct(),
PlotDataQuantiles(),
PlotDataRankRows(),
PlotDataRatio(),
PlotDataRecode(),
PlotDataRelative(),
PlotDataSelect(),
PlotDataShares(),
PlotDataSummarise(),
PlotDataUnite()
Examples
PlotDataKeyColours(1:25)
#> key colour
#> 1 1 #1f77b4
#> 2 2 #aec7e8
#> 3 3 #ff7f0e
#> 4 4 #ffbb78
#> 5 5 #2ca02c
#> 6 6 #98df8a
#> 7 7 #d62728
#> 8 8 #ff9896
#> 9 9 #9467bd
#> 10 10 #c5b0d5
#> 11 11 #8c564b
#> 12 12 #c49c94
#> 13 13 #e377c2
#> 14 14 #f7b6d2
#> 15 15 #7f7f7f
#> 16 16 #c7c7c7
#> 17 17 #bcbd22
#> 18 18 #dbdb8d
#> 19 19 #17becf
#> 20 20 #9edae5
#> 21 21 #393b79
#> 22 22 #5254a3
#> 23 23 #6b6ecf
#> 24 24 #9c9ede
#> 25 25 #637939