# Initial variables (first, second, third and fourth month of 2008 approximate values) deaths <- c(73,81,131,83); members <- c(47,60,55,59); kills <- c(251,304,234,452); months <- c("2008-01","2008-02","2008-03","2008-04"); x <- c(1,2,3,4) # First image, Kills and deaths on a plot diagram png("killsanddeaths.png") plot(x,kills, xlab="Month", ylab="Kills/Deaths", type="b", ylim=c(0,max(kills,deaths)), col="green") lines(x,deaths, type="b", col="red") title("Grey Council Efficiency") legend("bottomright",c("kills","deaths"),fill=c("green","red")) dev.off() # Second image, barplot of all kills, deaths, members for specific months, grouped by value type png("grouped_values.png") temp <- matrix(c(kills, deaths, members), ncol=3, dimnames = list(months,c("kills","deaths","members")),byrow=FALSE) barplot(temp, beside=TRUE, col=c("red","green","blue","pink"), legend.text=rownames(temp), main="Grouped per month by value type") dev.off() # Third image, simple barplot of kills per member on a monthly basis. png("simple_kpm.png") temp2 <- kills/members barplot(temp2, beside=TRUE, col=c("pink"), legend.text=months, ylim=c(0,10), main="kills per member") dev.off() # Fourth image, simple barplot but can be expanded to hold several corp kills per member on a graph. png("expanded_kpm.png") temp3 <- matrix(c(temp2), ncol=1, dimnames=list(months,c("Grey Council"))) barplot(temp3, beside=TRUE, col=c("red","green","blue","pink"), legend.text=months, main="Kills Per Member", sub="Grouped per month per corp") dev.off() # Fifth image, simple barplot of kills-deaths per member in corp per month png("expanded_kdpm.png") temp4 <- (kills-deaths)/members barplot(temp4, beside=TRUE, col=c("red","green","blue","pink"), legend.text=months, main="Kills-Deaths Per Member", ylim=c(0,10)) dev.off()