Mercurial > repos > greg > ks_distribution
comparison ks_distribution.R @ 27:23c0f5c519ac draft
Uploaded
| author | greg |
|---|---|
| date | Mon, 26 Jun 2017 10:05:56 -0400 |
| parents | da8615a486fe |
| children | 9b6252925ccf |
comparison
equal
deleted
inserted
replaced
| 26:da8615a486fe | 27:23c0f5c519ac |
|---|---|
| 95 items <- strsplit(cStr, ",") | 95 items <- strsplit(cStr, ",") |
| 96 for (item in items) { | 96 for (item in items) { |
| 97 color <- c(color, item) | 97 color <- c(color, item) |
| 98 } | 98 } |
| 99 num_colors_specified = length(color) | 99 num_colors_specified = length(color) |
| 100 if (num_colors_specified < number_comp): | 100 if (num_colors_specified < number_comp) |
| 101 { | 101 { |
| 102 for (i in num_colors_specified:number_comp) | 102 for (i in num_colors_specified:number_comp) |
| 103 { | 103 { |
| 104 if !(any(color=='red')) | 104 if (!any(color=='red')) |
| 105 { | 105 { |
| 106 color <- c(color, 'red') | 106 color <- c(color, 'red') |
| 107 } | 107 } |
| 108 else if !(any(color=='yellow')) | 108 else if (!any(color=='yellow')) |
| 109 { | 109 { |
| 110 color <- c(color, 'yellow') | 110 color <- c(color, 'yellow') |
| 111 } | 111 } |
| 112 else if !(any(color=='green')) | 112 else if (!any(color=='green')) |
| 113 { | 113 { |
| 114 color <- c(color, 'green') | 114 color <- c(color, 'green') |
| 115 } | 115 } |
| 116 else if !(any(color=='black')) | 116 else if (!any(color=='black')) |
| 117 { | 117 { |
| 118 color <- c(color, 'black') | 118 color <- c(color, 'black') |
| 119 } | 119 } |
| 120 else if !(any(color=='blue')) | 120 else if (!any(color=='blue')) |
| 121 { | 121 { |
| 122 color <- c(color, 'blue') | 122 color <- c(color, 'blue') |
| 123 } | 123 } |
| 124 else | 124 else |
| 125 { | 125 { |
