Created
May 20, 2014 18:25
-
-
Save kalebr/bfe4e75a1abd9b043612 to your computer and use it in GitHub Desktop.
select colors using a vector as indicies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = 5 | |
g = sample(1:n, 20, replace=T) | |
c = sapply(g, FUN=function(x) rainbow( n )[[x]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment