Created
August 31, 2014 00:12
-
-
Save HarlanH/1ea36cc7e436596fdfb5 to your computer and use it in GitHub Desktop.
VennEuler code for 3 statistical programming languages, per Randy Zwitch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using VennEuler | |
# 1 364 23.30% SAS only | |
# 10 350 22.41% Python only | |
# 11 70 4.48% Python and SAS | |
# 100 490 31.37% R only | |
# 101 68 4.35% R and SAS | |
# 110 200 12.80% R and Python | |
# 111 20 1.28% R, Python and SAS | |
labels = ["R", "Python", "SAS"] | |
mk(pattern, ct) = pattern .* fill(true, ct, 1) | |
data = vcat(mk([false false true], 354), | |
mk([false true false], 350), | |
mk([false true true], 70), | |
mk([true false false], 490), | |
mk([true false true], 68), | |
mk([true true false], 200), | |
mk([true true true], 20)) | |
eo = make_euler_object(labels, data, [EulerSpec(:circle, [.5, .5], [0, 0]), | |
EulerSpec(:triangle), EulerSpec(:square)], sizesum=.25) | |
(minf,minx,ret) = optimize(eo, random_state(eo), ftol=-1, xtol=0.0025, maxtime=60, pop=200) | |
println("got $minf at $minx (returned $ret)") | |
render("randy_venn.svg", eo, minx) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment