Index: trunk/tools/wsor/message_templates/R/visualize_edits_decrease.R |
— | — | @@ -54,25 +54,28 @@ |
55 | 55 | } |
56 | 56 | |
57 | 57 | |
58 | | -plot.control.vs.test.ggplot <- function(test_samples, control_samples) { |
| 58 | +# FUNCTION :: line.plot.results |
| 59 | +# |
| 60 | +# Generates metrics for the test and control template sets and visualizes the |
| 61 | +# |
| 62 | +# edit_count_min_lower - lower bound of plotting range for minumum number of editors |
| 63 | +# edit_count_min_upper - upper bound of plotting range for minumum number of editors |
| 64 | +# import_metrics - imports metrics files if TRUE |
| 65 | +# save_plot - saves plot if TRUE |
| 66 | +# registered - look at registered editors if TRUE (non-registered otherwise) |
| 67 | +# error_bars - display error bars if TRUE |
| 68 | +# |
59 | 69 | |
60 | | - df <- data.frame(x=1:length(test_samples), y_test=test_samples, y_ctrl=control_samples) |
| 70 | +line.plot.results <- function(edit_count_min_lower = 1, edit_count_min_upper = 10, import_metrics = FALSE, save_plot = TRUE, filename = 'ggplot_out_', registered = TRUE, error_bars = FALSE) |
| 71 | +{ |
| 72 | + # IMPORT DATA |
61 | 73 | |
62 | | - ggplot(df,aes(x)) + geom_line(aes(y=y_test,colour="Test")) + geom_line(aes(y=y_ctrl,colour="Control")) |
63 | | -} |
64 | | - |
65 | | - |
66 | | -# IMPORT DATA |
67 | | - |
68 | | -line.plot.results <- function(edit_count_min_lower = 1, edit_count_min_upper = 10, import_metrics = FALSE, save_plot = TRUE, registered = TRUE, error_bars = FALSE) |
69 | | -{ |
70 | 74 | # c(78,81) c(1,4) c(60,62,64,66,68,70,72,74,76) c(60,62,66,76) c(107,109,111,113,115) c(84,99,101,103,105) |
71 | | - template_indices_control <- c(84, 0) |
72 | | - |
73 | 75 | # c(79,82) c(2,3) c(61,63,65,67,69,71,73,75,77) c(61,63,67,77) c(108,110,114,116) c(85,86,100,102,104,106) |
74 | | - template_indices_test <- c(85, 0) |
75 | | - |
76 | 76 | # paste(home_dir,"output/metrics_1109_1209_z",sep="") paste(home_dir,"output/metrics_pt_z",sep="") paste(home_dir,"output/metrics_1018_1119_z",sep="") paste(home_dir,"output/metrics_1122_1222_z",sep="") |
| 77 | + |
| 78 | + template_indices_control <- c(84, 0) |
| 79 | + template_indices_test <- c(85, 0) |
77 | 80 | fname_first_part <- paste(home_dir,"output/metrics_1108_1202_z",sep="") |
78 | 81 | |
79 | 82 | if (import_metrics) |
— | — | @@ -126,6 +129,6 @@ |
127 | 130 | p <- p + scale_x_continuous('Minimum Edits before Template Posting') + scale_y_continuous('Mean % Decrease in Edit Activity') + opts(title = plot_title, legend.title = theme_blank()) |
128 | 131 | |
129 | 132 | if (save_plot) |
130 | | - ggsave(paste('/home/rfaulkner/trunk/projects/WSOR/message_templates/R/plots/huggle_short_1_2_',reg_str,'.png',sep=""),width=8) |
| 133 | + ggsave(paste('/home/rfaulkner/trunk/projects/WSOR/message_templates/R/plots/',filename,reg_str,'.png',sep=""),width=8) |
131 | 134 | } |
132 | 135 | |