changeset 48:5c48e4c497f4 draft

Uploaded
author greg
date Mon, 26 Jun 2017 14:20:47 -0400
parents 06461aa190f7
children 3a30d1b983b3
files ks_distribution.R
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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')