Skip to content

Commit

Permalink
more chart scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
yaph committed May 9, 2012
1 parent 6162eb8 commit 9a8576f
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 5 deletions.
22 changes: 22 additions & 0 deletions emotional_commits/amusement.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# comment.char = "" must be set due to # char in C#
tcir = read.table("merged_counts_amusement.csv", sep=",", header=TRUE, comment.char = "")
# order by issue_count descending then by language name
sorted_by_ratio <- tcir[with(tcir, order(-percentage, language)), ]

# open a device using png() and specify taget image file
png(filename="commit-messages-amusement-percentage.png",
width = 800, height = 600, units = "px", pointsize = 14
)

# vertical labels: las=2, margins: mar=c(bottom, left, top, right)
par(las=2, mar=c(6, 6, 2, 2))
bp <- barplot(sorted_by_ratio$percentage,
ylab="Percentage",
ylim=c(0,.08),
names.arg=sorted_by_ratio$language,
col=heat.colors(nrow(tcir))
)
text(bp, 0, round(sorted_by_ratio$percentage, 2), cex=.8, pos=3)

# close device
dev.off()
22 changes: 22 additions & 0 deletions emotional_commits/anger.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# comment.char = "" must be set due to # char in C#
tcir = read.table("merged_counts_anger.csv", sep=",", header=TRUE, comment.char = "")
# order by issue_count descending then by language name
sorted_by_ratio <- tcir[with(tcir, order(-percentage, language)), ]

# open a device using png() and specify taget image file
png(filename="commit-messages-anger-percentage.png",
width = 800, height = 600, units = "px", pointsize = 14
)

# vertical labels: las=2, margins: mar=c(bottom, left, top, right)
par(las=2, mar=c(6, 6, 2, 2))
bp <- barplot(sorted_by_ratio$percentage,
ylab="Percentage",
# ylim=c(0,.22),
names.arg=sorted_by_ratio$language,
col=heat.colors(nrow(tcir))
)
text(bp, 0, round(sorted_by_ratio$percentage, 2), cex=.8, pos=3)

# close device
dev.off()
9 changes: 4 additions & 5 deletions emotional_commits/issues.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@
# source('issues.R')

# comment.char = "" must be set due to # char in C#
tcir = read.table("merged_count_issues.csv", sep=",", header=TRUE, comment.char = "")
tcir = read.table("merged_counts_issues.csv", sep=",", header=TRUE, comment.char = "")
# order by issue_count descending then by language name
sorted_by_ratio <- tcir[with(tcir, order(-percentage, repository_language)), ]
sorted_by_ratio <- tcir[with(tcir, order(-percentage, language)), ]

# open a device using png() and specify taget image file
png(filename="commit-messages-issues-percentage.png",
width = 800, height = 600, units = "px", pointsize = 14
)

# vertical labels: las=2, margins: mar=c(bottom, left, top, right)
par(las=2, mar=c(6, 6, 4, 2))
par(las=2, mar=c(6, 6, 2, 2))
bp <- barplot(sorted_by_ratio$percentage,
main="Percentage of Commit Messages with Issues",
ylab="Percentage",
ylim=c(0,20),
names.arg=sorted_by_ratio$repository_language,
names.arg=sorted_by_ratio$language,
col=heat.colors(nrow(tcir))
)
text(bp, 0, round(sorted_by_ratio$percentage, 1), cex=.8, pos=3)
Expand Down
22 changes: 22 additions & 0 deletions emotional_commits/joy.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# comment.char = "" must be set due to # char in C#
tcir = read.table("merged_counts_joy.csv", sep=",", header=TRUE, comment.char = "")
# order by issue_count descending then by language name
sorted_by_ratio <- tcir[with(tcir, order(-percentage, language)), ]

# open a device using png() and specify taget image file
png(filename="commit-messages-joy-percentage.png",
width = 800, height = 600, units = "px", pointsize = 14
)

# vertical labels: las=2, margins: mar=c(bottom, left, top, right)
par(las=2, mar=c(6, 6, 2, 2))
bp <- barplot(sorted_by_ratio$percentage,
ylab="Percentage",
ylim=c(0,.18),
names.arg=sorted_by_ratio$language,
col=heat.colors(nrow(tcir))
)
text(bp, 0, round(sorted_by_ratio$percentage, 2), cex=.8, pos=3)

# close device
dev.off()
22 changes: 22 additions & 0 deletions emotional_commits/surprise.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# comment.char = "" must be set due to # char in C#
tcir = read.table("merged_counts_surprise.csv", sep=",", header=TRUE, comment.char = "")
# order by issue_count descending then by language name
sorted_by_ratio <- tcir[with(tcir, order(-percentage, language)), ]

# open a device using png() and specify taget image file
png(filename="commit-messages-surprise-percentage.png",
width = 800, height = 600, units = "px", pointsize = 14
)

# vertical labels: las=2, margins: mar=c(bottom, left, top, right)
par(las=2, mar=c(6, 6, 2, 2),mgp=c(4.5,1,0))
bp <- barplot(sorted_by_ratio$percentage,
ylab="Percentage",
# ylim=c(0,.18),
names.arg=sorted_by_ratio$language,
col=heat.colors(nrow(tcir))
)
text(bp, 0, round(sorted_by_ratio$percentage, 3), cex=.8, pos=3)

# close device
dev.off()
22 changes: 22 additions & 0 deletions emotional_commits/swearing.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# comment.char = "" must be set due to # char in C#
tcir = read.table("merged_counts_swearing.csv", sep=",", header=TRUE, comment.char = "")
# order by issue_count descending then by language name
sorted_by_ratio <- tcir[with(tcir, order(-percentage, language)), ]

# open a device using png() and specify taget image file
png(filename="commit-messages-swearing-percentage.png",
width = 800, height = 600, units = "px", pointsize = 14
)

# vertical labels: las=2, margins: mar=c(bottom, left, top, right)
par(las=2, mar=c(6, 6, 2, 2))
bp <- barplot(sorted_by_ratio$percentage,
ylab="Percentage",
# ylim=c(0,.18),
names.arg=sorted_by_ratio$language,
col=heat.colors(nrow(tcir))
)
text(bp, 0, round(sorted_by_ratio$percentage, 2), cex=.8, pos=3)

# close device
dev.off()

0 comments on commit 9a8576f

Please sign in to comment.