Mercurial > repos > greg > ks_distribution
comparison ks_distribution.R @ 50:0b3d12ecce28 draft
Uploaded
author | greg |
---|---|
date | Mon, 26 Jun 2017 14:28:27 -0400 |
parents | 3a30d1b983b3 |
children | 1a3973eea61c |
comparison
equal
deleted
inserted
replaced
49:3a30d1b983b3 | 50:0b3d12ecce28 |
---|---|
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 specified_colors <- c('red', 'yellow', 'green', 'black', 'blue', 'darkorange') | 22 specified_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 specified_colors <- c() | |
26 colors <- as.character(colors) | 25 colors <- as.character(colors) |
27 items <- strsplit(colors, ",") | 26 specified_colors <- strsplit(colors, ",") |
28 for (item in items) { | |
29 specified_colors <- c(specified_colors, item) | |
30 } | |
31 num_colors_specified <- length(specified_colors) | 27 num_colors_specified <- length(specified_colors) |
32 if (num_colors_specified < number_comp) { | 28 if (num_colors_specified < number_comp) { |
33 for (i in num_colors_specified:number_comp) { | 29 for (i in num_colors_specified:number_comp) { |
34 if (!('red' %in% names(specified_colors))) { | 30 if (!('red' %in% names(specified_colors))) { |
35 specified_colors <- c(specified_colors, 'red') | 31 specified_colors <- c(specified_colors, 'red') |