Mercurial > repos > greg > ks_distribution
comparison ks_distribution.R @ 46:399cd9dd2c3e draft
Uploaded
| author | greg |
|---|---|
| date | Mon, 26 Jun 2017 14:09:09 -0400 |
| parents | f8b303b9f455 |
| children | 06461aa190f7 |
comparison
equal
deleted
inserted
replaced
| 45:f8b303b9f455 | 46:399cd9dd2c3e |
|---|---|
| 29 specified_colors <- c(specified_colors, item) | 29 specified_colors <- c(specified_colors, item) |
| 30 } | 30 } |
| 31 num_colors_specified <- length(specified_colors) | 31 num_colors_specified <- length(specified_colors) |
| 32 if (num_colors_specified < number_comp) { | 32 if (num_colors_specified < number_comp) { |
| 33 for (i in num_colors_specified:number_comp) { | 33 for (i in num_colors_specified:number_comp) { |
| 34 if (!any(specified_colors == 'red')) { | 34 if (!grep('red', specified_colors)) { |
| 35 specified_colors <- c(specified_colors, 'red') | 35 specified_colors <- c(specified_colors, 'red') |
| 36 } else if (!any(specified_colors == 'yellow')) { | 36 } else if (!grep('yellow', specified_colors)) { |
| 37 specified_colors <- c(specified_colors, 'yellow') | 37 specified_colors <- c(specified_colors, 'yellow') |
| 38 } else if (!any(specified_colors == 'green')) { | 38 } else if (!grep('green', specified_colors)) { |
| 39 specified_colors <- c(specified_colors, 'green') | 39 specified_colors <- c(specified_colors, 'green') |
| 40 } else if (!any(specified_colors == 'black')) { | 40 } else if (!grep('black', specified_colors)) { |
| 41 specified_colors <- c(specified_colors, 'black') | 41 specified_colors <- c(specified_colors, 'black') |
| 42 } else if (!any(specified_colors == 'blue')) { | 42 } else if (!grep('blue', specified_colors)) { |
| 43 specified_colors <- c(specified_colors, 'blue') | 43 specified_colors <- c(specified_colors, 'blue') |
| 44 } else { | 44 } else { |
| 45 specified_colors <- c(specified_colors, 'darkorange') | 45 specified_colors <- c(specified_colors, 'darkorange') |
| 46 } | 46 } |
| 47 } | 47 } |
