Skip to content

Instantly share code, notes, and snippets.

@takehiko
Created July 15, 2014 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takehiko/c0c8bad2be643014ce83 to your computer and use it in GitHub Desktop.
Save takehiko/c0c8bad2be643014ce83 to your computer and use it in GitHub Desktop.
Kuku (a.k.a. multiplication table) Answer Accuracy
# kukuplot.R - Kuku (a.k.a. multiplication table) Answer Accuracy
# by takehikom
# http://berd.benesse.jp/berd/center/open/report/keisanryoku/2013/pdf/keisanryoku_2013_data_all.pdf#page=15
# http://i.imgur.com/tE4ncBy.gif
# http://qiita.com/wakuteka/items/c5910a54273d05577c5d
library(lattice)
kuku.acc <- c(
99.7, 99.9, 99.6, 99.8, 99.9, 99.8, 99.8, 99.9, 100.0,
100.0, 99.7, 99.1, 99.3, 99.0, 98.8, 96.6, 98.1, 99.0,
99.8, 99.3, 98.4, 95.6, 98.8, 99.0, 97.2, 96.9, 98.5,
99.6, 98.5, 98.7, 97.7, 97.6, 97.6, 93.6, 94.0, 98.5,
100.0, 99.6, 99.7, 99.3, 99.4, 98.8, 97.9, 96.9, 99.2,
99.9, 99.0, 96.7, 95.8, 96.7, 98.3, 96.2, 90.0, 97.4,
99.7, 96.2, 96.1, 93.6, 98.2, 92.3, 94.2, 96.1, 96.8,
100.0, 96.2, 95.8, 94.9, 97.6, 90.7, 95.7, 96.5, 97.4,
99.0, 99.7, 97.1, 95.5, 98.0, 98.3, 97.2, 98.4, 99.9
)
my.mat <- matrix(data = kuku.acc, nrow = 9, ncol = 9)
xmin <- 89
xmax <- 100
xby <- 0.05
pal <- colorRampPalette(c("#CD0204", "#FC0204", "#FC5604", "#FCAA04",
"#FCFE06", "#BCFE41", "#79FE79", "#45FEBF",
"#04FEFC", "#04A9FC", "#0456FC", "#0403F5",
"#040291"),
space = "rgb")
png('kukuplot.png')
levelplot(my.mat,
main = "Kuku Answer Accuracy",
xlab = "Multiplier", ylab = "Multiplicand",
col.regions = pal, cuts = 20,
at = seq(from = xmin, to = xmax, by = xby))
dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment