Mercurial > repos > greg > ks_distribution
changeset 58:9ca7354c86a1 draft
Uploaded
author | greg |
---|---|
date | Mon, 26 Jun 2017 14:59:30 -0400 |
parents | 5db52c7bdccb |
children | c5fb4e2ed4e2 |
files | ks_distribution.R |
diffstat | 1 files changed, 18 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/ks_distribution.R Mon Jun 26 14:54:53 2017 -0400 +++ b/ks_distribution.R Mon Jun 26 14:59:30 2017 -0400 @@ -28,24 +28,24 @@ for (item in items) { component_colors <- c(component_colors, item) } - #num_colors_specified <- length(component_colors) - #if (num_colors_specified < number_comp) { - # for (i in num_colors_specified:number_comp) { - # if (!('red' %in% names(component_colors))) { - # component_colors <- c(component_colors, 'red') - # } else if (!('yellow' %in% names(component_colors))) { - # component_colors <- c(component_colors, 'yellow') - # } else if (!('green' %in% names(component_colors))) { - # component_colors <- c(component_colors, 'green') - # } else if (!('black' %in% names(component_colors))) { - # component_colors <- c(component_colors, 'black') - # } else if (!('blue' %in% names(component_colors))) { - # component_colors <- c(component_colors, 'blue') - # } else { - # component_colors <- c(component_colors, 'darkorange') - # } - # } - #} + num_colors_specified <- length(component_colors) + if (num_colors_specified < number_comp) { + for (i in num_colors_specified:number_comp) { + if (!('red' %in% names(component_colors))) { + component_colors <- c(component_colors, 'red') + } else if (!('yellow' %in% names(component_colors))) { + component_colors <- c(component_colors, 'yellow') + } else if (!('green' %in% names(component_colors))) { + component_colors <- c(component_colors, 'green') + } else if (!('black' %in% names(component_colors))) { + component_colors <- c(component_colors, 'black') + } else if (!('blue' %in% names(component_colors))) { + component_colors <- c(component_colors, 'blue') + } else { + component_colors <- c(component_colors, 'darkorange') + } + } + } } return(component_colors) }