dataset1 <- function(){
library('ggplot2')
library('plotly')
# handwritten letter 'd' (uncomment to test)
data1 = matrix( c(442, 442, 442, 443, 446, 439, 437, 427, 419, 410, 403, 397,
396, 398, 404, 413, 426, 439, 455, 476, 499, 527, 558, 589,
623, 655, 683, 706, 722, 730, 731, 722, 707, 684, 658, 629,
598, 569, 540, 525, 512, 508, 511, 521, 523, 512, 512, 524,
539, 581, 637, 710, 791, 888, 981, 1075, 1160, 1232, 1287, 1324,
1340, 1340, 1325, 1298, 1257, 1213, 1165, 1120, 1082, 1053, 1034,
1030, 1040, 1061, 1093, 1128, 1168, 1208, 1243, 1276, 1300, 1312,
1314, 1308, 1301, 1285, 1270, 1258), ncol = 2)
data1 = -data1
data2 = matrix( c(407, 402, 402, 402, 396, 393, 397, 399, 404, 407, 409, 412,
413, 415, 414, 413, 415, 415, 421, 425, 433, 445, 459, 480,
504, 534, 569, 609, 650, 691, 730, 765, 792, 811, 817, 811,
793, 763, 722, 676, 625, 572, 518, 479, 442, 419, 408, 408,
420, 408, 408, 408, 432, 472, 526, 595, 677, 767, 854, 941,
1017, 1087, 1135, 1168, 1181, 1181, 1171, 1151, 1118, 1084, 1041,
1004, 975, 949, 934, 928, 938, 954, 981, 1012, 1044, 1080, 1117,
1148, 1173, 1191, 1205, 1213, 1215, 1209, 1199, 1187, 1178, 1171,
1158, 1158), ncol = 2)
data2 = -data2
p1 <- qplot(data1[, 1], data1[, 2], geom = 'point')
p2 <- qplot(data2[, 1], data2[, 2], geom = 'point')
p <- subplot(p1, p2)
return(list(X1 = data1, X2 = data2, p = p))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.