Mercurial > repos > greg > ks_distribution
comparison ks_distribution.R @ 52:53bc81f3ebad draft
Uploaded
author | greg |
---|---|
date | Mon, 26 Jun 2017 14:42:41 -0400 |
parents | 1a3973eea61c |
children | b3333795c1f9 |
comparison
equal
deleted
inserted
replaced
51:1a3973eea61c | 52:53bc81f3ebad |
---|---|
20 if (is.na(colors) == 0) { | 20 if (is.na(colors) == 0) { |
21 # Randomly specify colors for components. | 21 # Randomly specify colors for components. |
22 component_colors <- c('red', 'yellow', 'green', 'black', 'blue', 'darkorange') | 22 component_colors <- c('red', 'yellow', 'green', 'black', 'blue', 'darkorange') |
23 } else { | 23 } else { |
24 # Handle selected colors for components. | 24 # Handle selected colors for components. |
25 component_colors <- c() | |
25 colors <- as.character(colors) | 26 colors <- as.character(colors) |
26 component_colors <- strsplit(colors, ",") | 27 items <- strsplit(colors, ",") |
28 for item in items { | |
29 component_colors <- c(component_colors, as.character(item)) | |
30 } | |
27 num_colors_specified <- length(component_colors) | 31 num_colors_specified <- length(component_colors) |
28 if (num_colors_specified < number_comp) { | 32 if (num_colors_specified < number_comp) { |
29 for (i in num_colors_specified:number_comp) { | 33 for (i in num_colors_specified:number_comp) { |
30 if (!('red' %in% names(component_colors))) { | 34 if (!('red' %in% names(component_colors))) { |
31 component_colors <- c(component_colors, 'red') | 35 component_colors <- c(component_colors, 'red') |