Mercurial > repos > greg > ks_distribution
comparison ks_distribution.R @ 39:686ea47c0ce3 draft
Uploaded
| author | greg |
|---|---|
| date | Mon, 26 Jun 2017 11:58:46 -0400 |
| parents | ee4ebdf2935e |
| children | 17ca41359a2d |
comparison
equal
deleted
inserted
replaced
| 38:68447763ccc2 | 39:686ea47c0ce3 |
|---|---|
| 30 items <- strsplit(cStr, ",") | 30 items <- strsplit(cStr, ",") |
| 31 for (item in items) | 31 for (item in items) |
| 32 { | 32 { |
| 33 specified_colors <- c(specified_colors, item) | 33 specified_colors <- c(specified_colors, item) |
| 34 } | 34 } |
| 35 num_colors_specified = length(specified_colors) | 35 num_colors_specified <- length(specified_colors) |
| 36 if (num_colors_specified < number_comp) | 36 if (num_colors_specified < number_comp) |
| 37 { | 37 { |
| 38 for (i in num_colors_specified:number_comp) | 38 for (i in num_colors_specified:number_comp) |
| 39 { | 39 { |
| 40 if (!any(specified_colors=='red')) | 40 if (!any(specified_colors=='red')) |
| 166 # Read in the components data. | 166 # Read in the components data. |
| 167 components_data <- read.delim(opt$components_input, header=TRUE) | 167 components_data <- read.delim(opt$components_input, header=TRUE) |
| 168 number_comp <- opt$number_comp | 168 number_comp <- opt$number_comp |
| 169 | 169 |
| 170 # Set component colors. | 170 # Set component colors. |
| 171 specified_colors = set_component_colors(opt$colors, number_comp) | 171 specified_colors <- set_component_colors(opt$colors, number_comp) |
| 172 | 172 |
| 173 # Set pi, mu, var. | 173 # Set pi, mu, var. |
| 174 items <- get_pi_mu_var(components_data, number_comp) | 174 items <- get_pi_mu_var(components_data, number_comp) |
| 175 if (number_comp == 1) | 175 if (number_comp == 1) |
| 176 { | 176 { |
