Index: trunk/tools/wsor/message_templates/R/huggle3_analysis.R |
— | — | @@ -6,14 +6,14 @@ |
7 | 7 | |
8 | 8 | # Read aggregated results for z64 |
9 | 9 | |
10 | | -metrics_ec_z64 = read.table("/home/rfaulk/WSOR/message_templates/output/metrics_1018_1119_z64_editcounts.tsv", na.strings="\\N", sep="\t", comment.char="", quote="", header=T) |
11 | | -metrics_blocks_z64 = read.table("/home/rfaulk/WSOR/message_templates/output/metrics_1018_1119_z64_blocks.tsv", na.strings="\\N", sep="\t", comment.char="", quote="", header=T) |
| 10 | +metrics_ec_z64 = read.table("/home/rfaulk/WSOR/message_templates/output/metrics_1018_1119_z70_editcounts.tsv", na.strings="\\N", sep="\t", comment.char="", quote="", header=T) |
| 11 | +metrics_blocks_z64 = read.table("/home/rfaulk/WSOR/message_templates/output/metrics_1018_1119_z70_blocks.tsv", na.strings="\\N", sep="\t", comment.char="", quote="", header=T) |
12 | 12 | |
13 | 13 | |
14 | 14 | # Read aggregated results for z65 |
15 | 15 | |
16 | | -metrics_ec_z65 = read.table("/home/rfaulk/WSOR/message_templates/output/metrics_1018_1119_z65_editcounts.tsv", na.strings="\\N", sep="\t", comment.char="", quote="", header=T) |
17 | | -metrics_blocks_z65 = read.table("/home/rfaulk/WSOR/message_templates/output/metrics_1018_1119_z65_blocks.tsv", na.strings="\\N", sep="\t", comment.char="", quote="", header=T) |
| 16 | +metrics_ec_z65 = read.table("/home/rfaulk/WSOR/message_templates/output/metrics_1018_1119_z71_editcounts.tsv", na.strings="\\N", sep="\t", comment.char="", quote="", header=T) |
| 17 | +metrics_blocks_z65 = read.table("/home/rfaulk/WSOR/message_templates/output/metrics_1018_1119_z71_blocks.tsv", na.strings="\\N", sep="\t", comment.char="", quote="", header=T) |
18 | 18 | |
19 | 19 | |
20 | 20 | # Compute max edit counts |
— | — | @@ -24,21 +24,18 @@ |
25 | 25 | max_ec_z65_ns_3 = max(append(metrics_ec_z65['ns_3_revisions_before'][[1]], metrics_ec_z65['ns_3_revisions_after'][[1]])) |
26 | 26 | |
27 | 27 | |
28 | | -# Compute edit count vectors -- normalize values by the maximum, these are effectively representations of relative increase or decrease |
29 | | -# of edit activity after the template has been placed |
| 28 | +# Compute the increase |
30 | 29 | |
31 | | -z64_ns0 = (metrics_ec_z64['ns_0_revisions_before'][[1]] - metrics_ec_z64['ns_0_revisions_after'][[1]]) / metrics_ec_z64['ns_0_revisions_before'][[1]] |
32 | | -z65_ns0 = (metrics_ec_z65['ns_0_revisions_before'][[1]] - metrics_ec_z65['ns_0_revisions_after'][[1]]) / metrics_ec_z65['ns_0_revisions_before'][[1]] |
33 | | -# z64_ns3 = (metrics_ec_z64['ns_3_revisions_before'][[1]] - metrics_ec_z64['ns_3_revisions_after'][[1]]) / metrics_ec_z64['ns_3_revisions_before'][[1]] |
34 | | -# z65_ns3 = (metrics_ec_z65['ns_3_revisions_before'][[1]] - metrics_ec_z65['ns_3_revisions_after'][[1]]) / metrics_ec_z65['ns_3_revisions_before'][[1]] |
| 30 | +z64_ns0 = (metrics_ec_z64$ns_0_revisions_after - metrics_ec_z64$ns_0_revisions_before) / metrics_ec_z64$ns_0_revisions_before |
| 31 | +z65_ns0 = (metrics_ec_z65$ns_0_revisions_after - metrics_ec_z65$ns_0_revisions_before / metrics_ec_z65$ns_0_revisions_before |
35 | 32 | |
36 | | -# z64_ns0 <- c() |
37 | | -# z65_ns0 <- c() |
38 | | -z64_ns3 <- c() |
39 | | -z65_ns3 <- c() |
40 | 33 | |
| 34 | +# User Talk namespace does not necessarily have edits before - in this case omit the result (it could be the case that templates stimulate user talk edits but that should be tested separately) |
41 | 35 | # Only append non-zero results - do this for just namespace 3 since it has zero entries for 'ns_3_revisions_before' |
42 | 36 | |
| 37 | +z64_ns3 <- c() |
| 38 | +z65_ns3 <- c() |
| 39 | + |
43 | 40 | for (i in 1:length(metrics_ec_z64['ns_3_revisions_before'][[1]])) |
44 | 41 | if (metrics_ec_z64['ns_3_revisions_before'][[1]][i] != 0) |
45 | 42 | z64_ns3 <- c(z64_ns3, |