# HG changeset patch # User greg # Date 1498500549 14400 # Node ID 399cd9dd2c3e4a3a3338a466eca9745f4631fb7b # Parent f8b303b9f455ec8ffe860f0e89356ff47ff87d32 Uploaded diff -r f8b303b9f455 -r 399cd9dd2c3e ks_distribution.R --- a/ks_distribution.R Mon Jun 26 14:03:11 2017 -0400 +++ b/ks_distribution.R Mon Jun 26 14:09:09 2017 -0400 @@ -31,15 +31,15 @@ num_colors_specified <- length(specified_colors) if (num_colors_specified < number_comp) { for (i in num_colors_specified:number_comp) { - if (!any(specified_colors == 'red')) { + if (!grep('red', specified_colors)) { specified_colors <- c(specified_colors, 'red') - } else if (!any(specified_colors == 'yellow')) { + } else if (!grep('yellow', specified_colors)) { specified_colors <- c(specified_colors, 'yellow') - } else if (!any(specified_colors == 'green')) { + } else if (!grep('green', specified_colors)) { specified_colors <- c(specified_colors, 'green') - } else if (!any(specified_colors == 'black')) { + } else if (!grep('black', specified_colors)) { specified_colors <- c(specified_colors, 'black') - } else if (!any(specified_colors == 'blue')) { + } else if (!grep('blue', specified_colors)) { specified_colors <- c(specified_colors, 'blue') } else { specified_colors <- c(specified_colors, 'darkorange')