#have you set your image working directory yet?
setwd("/home/marco/images")
killcount=sort(structure(c(9L, 6L, 89L, 33L, 8L, 34L), .Dim = 6L, .Dimnames = structure(list(
dat = c("bugman", "CowboyBear", "Dason", "Dragan", "quark",
"TheEcologist")), .Names = "dat"), class = "table"))
# Movie Villains kill stats taken from the net
villains=structure(list(Kills = c(6, 10, 18, 22, 32, 35, 42, 57, 64),
name = structure(c(8L, 1L, 5L, 2L, 3L, 4L, 6L, 9L, 7L), .Label = c("Alien",
"Jason", "Chucky", "DarthVader", "Dracula", "FreddyKrueger",
"Predator", "Raptors", "Terminator"), class = "factor")), .Names = c("Kills",
"name"), row.names = c(4L, 3L, 5L, 7L, 8L, 6L, 9L, 2L, 1L), class = "data.frame")
#blood palette
tibetanmonk.colors=colorRampPalette(c("#FC580C","#FC6B0A","#F8872E","#FFA927","#FDCA49"))
# Blood splash background
require(biOps)
bloodbackground=readJpeg("bloodspatter.jpeg")
# Add labels and text
text(1,1,"A")
#layout matrix made earlier in spreadsheet program
layoutmat=
structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 77L, 1L, 17L, 26L, 35L,
44L, 53L, 62L, 8L, 1L, 18L, 27L, 36L, 45L, 54L, 63L, 9L, 1L,
19L, 28L, 37L, 46L, 55L, 64L, 10L, 1L, 20L, 29L, 38L, 47L, 56L,
65L, 11L, 1L, 21L, 30L, 39L, 48L, 57L, 66L, 12L, 1L, 22L, 31L,
40L, 49L, 58L, 67L, 13L, 1L, 23L, 32L, 41L, 50L, 59L, 68L, 14L,
1L, 24L, 33L, 42L, 51L, 60L, 69L, 15L, 1L, 25L, 34L, 43L, 52L,
61L, 70L, 16L, 1L, 71L, 72L, 73L, 74L, 75L, 76L, 1L), .Dim = c(8L,
11L), .Dimnames = list(NULL, c("V1", "V2", "V3", "V4", "V5",
"V6", "V7", "V8", "V9", "V10", "V11")))
# Load avatars
Avatars=vector("list",5)
Avatars[[6]]=readJpeg("ClassyDogCropSmallPng.jpg")
Avatars[[4]]=readJpeg("avat2.jpg")
Avatars[[2]]=readJpeg("darkhorse.jpg")
Avatars[[3]]=readJpeg("index.jpeg")
Avatars[[5]]=readJpeg("Viva-La-Evolucion-T-Shirt-(8147).jpg")
Avatars[[1]]=readJpeg("Mr.jpg")
par(mar=c(0,0,0,0),xaxt="n",yaxt="n")
layout(layoutmat)
plot(bloodbackground)
# add text
lims=dim(bloodbackground)[1:2]
#Title
text(lims[2]/2,lims[1]-40,expression(bold("How Moderators Compare to Movie Villains")),cex=3,col="blue")
# MLE
text(lims[2]-40,lims[1]-60,expression(bold("MLE")),cex=2,col="blue")
#mod
text(0+40,lims[1]-60.5,expression(bold("MOD")),cex=2,col="blue")
for(i in 1:6){
plot(Avatars[[i]])
}
for(i in 1:9){
vilpic=readJpeg(paste(villains[,2][i],".jpg",sep=""))
plot(vilpic)
}
for(i in 1:6){
for (j in 1:dim(villains)[1]){
barplot(dpois(villains[j,1],killcount[i]),
col=tibetanmonk.colors(dim(villains)[1])[j],
ylim=c(0,max(dpois(villains[,1],killcount[i]))))
}
}
for(i in 1:6){
l=dpois(villains[,1],killcount[i])
mle=which(l==max(l))
vilpic=readJpeg(paste(villains[,2]
[mle],".jpg",sep=""))
plot(vilpic)
}
plot(-100,ylim=c(0,1),xlim=c(0,1))