# HG changeset patch # User greg # Date 1498501247 14400 # Node ID 5c48e4c497f4041d63ce3b84c009e5e32bf5ebde # Parent 06461aa190f7db707a450b06d9bcee1aed6b8e74 Uploaded diff -r 06461aa190f7 -r 5c48e4c497f4 ks_distribution.R --- a/ks_distribution.R Mon Jun 26 14:13:03 2017 -0400 +++ b/ks_distribution.R Mon Jun 26 14:20:47 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 (!grep('red', specified_colors)) { + if (!('red' %in% names(specified_colors))) { specified_colors <- c(specified_colors, 'red') - } else if (!grep('yellow', specified_colors)) { + } else if ((!('yellow' %in% names(specified_colors))) { specified_colors <- c(specified_colors, 'yellow') - } else if (!grep('green', specified_colors)) { + } else if (!('green' %in% names(specified_colors))) { specified_colors <- c(specified_colors, 'green') - } else if (!grep('black', specified_colors)) { + } else if (!('black' %in% names(specified_colors))) { specified_colors <- c(specified_colors, 'black') - } else if (!grep('blue', specified_colors)) { + } else if (!('blue' %in% names(specified_colors))) { specified_colors <- c(specified_colors, 'blue') } else { specified_colors <- c(specified_colors, 'darkorange')