Sharedsupport / 2017-01-09-175503.texOpen in CoCalc
Authors: Harald Schilly, ℏal Snyder, William A. Stein
License: GNU General Public License v3.0
Description: Examples for support purposes.
1
\documentclass[12pt]{article}\usepackage[]{graphicx}\usepackage[]{color}
2
%% maxwidth is the original width if it is less than linewidth
3
%% otherwise use linewidth (to make sure the graphics do not exceed the margin)
4
\makeatletter
5
\def\maxwidth{ %
6
\ifdim\[email protected]@width>\linewidth
7
\linewidth
8
\else
9
\[email protected]@width
10
\fi
11
}
12
\makeatother
13
14
\definecolor{fgcolor}{rgb}{0.345, 0.345, 0.345}
15
\newcommand{\hlnum}[1]{\textcolor[rgb]{0.686,0.059,0.569}{#1}}%
16
\newcommand{\hlstr}[1]{\textcolor[rgb]{0.192,0.494,0.8}{#1}}%
17
\newcommand{\hlcom}[1]{\textcolor[rgb]{0.678,0.584,0.686}{\textit{#1}}}%
18
\newcommand{\hlopt}[1]{\textcolor[rgb]{0,0,0}{#1}}%
19
\newcommand{\hlstd}[1]{\textcolor[rgb]{0.345,0.345,0.345}{#1}}%
20
\newcommand{\hlkwa}[1]{\textcolor[rgb]{0.161,0.373,0.58}{\textbf{#1}}}%
21
\newcommand{\hlkwb}[1]{\textcolor[rgb]{0.69,0.353,0.396}{#1}}%
22
\newcommand{\hlkwc}[1]{\textcolor[rgb]{0.333,0.667,0.333}{#1}}%
23
\newcommand{\hlkwd}[1]{\textcolor[rgb]{0.737,0.353,0.396}{\textbf{#1}}}%
24
\let\hlipl\hlkwb
25
26
\usepackage{framed}
27
\makeatletter
28
\newenvironment{kframe}{%
29
\def\[email protected]@[email protected]{}%
30
\ifinner\ifhmode%
31
\def\[email protected]@[email protected]{\end{minipage}}%
32
\begin{minipage}{\columnwidth}%
33
\fi\fi%
34
\def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep
35
\colorbox{shadecolor}{##1}\hskip-\fboxsep
36
% There is no \\@totalrightmargin, so:
37
\hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
38
\MakeFramed {\advance\hsize-\width
39
\@totalleftmargin\[email protected] \linewidth\hsize
40
\@setminipage}}%
41
{\par\unskip\endMakeFramed%
42
\[email protected]@[email protected]}
43
\makeatother
44
45
\definecolor{shadecolor}{rgb}{.97, .97, .97}
46
\definecolor{messagecolor}{rgb}{0, 0, 0}
47
\definecolor{warningcolor}{rgb}{1, 0, 1}
48
\definecolor{errorcolor}{rgb}{1, 0, 0}
49
\newenvironment{knitrout}{}{} % an empty environment to be redefined in TeX
50
51
\usepackage{alltt}
52
53
\usepackage{times}
54
\usepackage{hyperref}
55
\hypersetup{pdfpagemode=UseNone} % don't show bookmarks on initial view
56
\hypersetup{colorlinks, urlcolor={blue}}
57
58
% revise margins
59
\setlength{\headheight}{0.0in}
60
\setlength{\topmargin}{0.0in}
61
\setlength{\headsep}{0.0in}
62
\setlength{\textheight}{8.65in}
63
\setlength{\footskip}{0.35in}
64
\setlength{\oddsidemargin}{0.0in}
65
\setlength{\evensidemargin}{0.0in}
66
\setlength{\textwidth}{6.5in}
67
68
\setlength{\parskip}{6pt}
69
\setlength{\parindent}{0pt}
70
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
71
\begin{document}
72
73
\begin{knitrout}
74
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
75
\begin{alltt}
76
\hlkwd{library}\hlstd{(knitr)}
77
\hlcom{# global chunk options}
78
\hlstd{opts_chunk}\hlopt{$}\hlkwd{set}\hlstd{(}\hlkwc{cache}\hlstd{=}\hlnum{TRUE}\hlstd{,} \hlkwc{autodep}\hlstd{=}\hlnum{TRUE}\hlstd{)}
79
\end{alltt}
80
\end{kframe}
81
\end{knitrout}
82
83
\begin{knitrout}
84
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
85
\begin{alltt}
86
\hlnum{1}\hlopt{+}\hlnum{1}
87
\end{alltt}
88
\begin{verbatim}
89
## [1] 2
90
\end{verbatim}
91
\end{kframe}
92
\end{knitrout}
93
94
x
95
96
\begin{knitrout}
97
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
98
\begin{alltt}
99
\hlnum{1}\hlopt{+}\hlnum{1}
100
\end{alltt}
101
\begin{verbatim}
102
## [1] 2
103
\end{verbatim}
104
\end{kframe}
105
\end{knitrout}
106
107
x
108
109
\begin{knitrout}
110
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
111
\begin{alltt}
112
\hlnum{1}\hlopt{+}\hlnum{1}
113
\end{alltt}
114
\begin{verbatim}
115
## [1] 2
116
\end{verbatim}
117
\end{kframe}
118
\end{knitrout}
119
120
ANOTHER TEST
121
122
\begin{knitrout}
123
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
124
\begin{alltt}
125
\hlnum{1}\hlopt{+}\hlnum{1}
126
\end{alltt}
127
\begin{verbatim}
128
## [1] 2
129
\end{verbatim}
130
\end{kframe}
131
\end{knitrout}
132
133
x
134
135
\begin{knitrout}
136
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
137
\begin{alltt}
138
\hlnum{1}\hlopt{+}\hlnum{1}
139
\end{alltt}
140
\begin{verbatim}
141
## [1] 2
142
\end{verbatim}
143
\end{kframe}
144
\end{knitrout}
145
146
x^
147
148
\begin{knitrout}
149
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
150
\begin{alltt}
151
\hlnum{1}\hlopt{+}\hlnum{1}
152
\end{alltt}
153
\begin{verbatim}
154
## [1] 2
155
\end{verbatim}
156
\end{kframe}
157
\end{knitrout}
158
159
x
160
161
\begin{knitrout}
162
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
163
\begin{alltt}
164
\hlnum{1}\hlopt{+}\hlnum{1}
165
\end{alltt}
166
\begin{verbatim}
167
## [1] 2
168
\end{verbatim}
169
\end{kframe}
170
\end{knitrout}
171
172
\begin{itemize}
173
174
\item
175
176
\end{itemize}
177
178
179
\begin{knitrout}
180
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
181
\begin{alltt}
182
\hlnum{1}\hlopt{+}\hlnum{1}
183
\end{alltt}
184
\begin{verbatim}
185
## [1] 2
186
\end{verbatim}
187
\end{kframe}
188
\end{knitrout}
189
190
x
191
192
\begin{knitrout}
193
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
194
\begin{alltt}
195
\hlnum{1}\hlopt{+}\hlnum{1}
196
\end{alltt}
197
\begin{verbatim}
198
## [1] 2
199
\end{verbatim}
200
\end{kframe}
201
\end{knitrout}
202
203
x
204
205
\begin{knitrout}
206
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
207
\begin{alltt}
208
\hlnum{1}\hlopt{+}\hlnum{1}
209
\end{alltt}
210
\begin{verbatim}
211
## [1] 2
212
\end{verbatim}
213
\end{kframe}
214
\end{knitrout}
215
216
x
217
218
\begin{knitrout}
219
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
220
\begin{alltt}
221
\hlnum{1}\hlopt{+}\hlnum{1}
222
\end{alltt}
223
\begin{verbatim}
224
## [1] 2
225
\end{verbatim}
226
\end{kframe}
227
\end{knitrout}
228
229
TEST
230
231
\begin{knitrout}
232
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
233
\begin{alltt}
234
\hlnum{1}\hlopt{+}\hlnum{1}
235
\end{alltt}
236
\begin{verbatim}
237
## [1] 2
238
\end{verbatim}
239
\end{kframe}
240
\end{knitrout}
241
242
x
243
244
y
245
246
z
247
x
248
249
y
250
251
z
252
x
253
254
y
255
256
z
257
x
258
259
y
260
261
z
262
x
263
264
y
265
266
z
267
x
268
269
y
270
271
z
272
x
273
274
y
275
276
z
277
x
278
279
y
280
281
z
282
x
283
284
y
285
286
z
287
x
288
289
y
290
291
z
292
x
293
294
y
295
296
z
297
x
298
299
y
300
301
z
302
x
303
304
y
305
306
z
307
x
308
309
y
310
311
z
312
x
313
314
y
315
316
z
317
x
318
319
y
320
321
z
322
x
323
324
y
325
326
z
327
x
328
329
y
330
331
z
332
x
333
334
y
335
336
z
337
x
338
339
y
340
341
z
342
x
343
344
y
345
346
z
347
x
348
349
y
350
351
z
352
x
353
354
y
355
356
z
357
x
358
359
y
360
361
z
362
x
363
364
y
365
366
z
367
x
368
369
y
370
371
z
372
x
373
374
y
375
376
z
377
x
378
379
y
380
381
z
382
x
383
384
y
385
386
z
387
x
388
389
y
390
391
z
392
x
393
394
y
395
396
z
397
x
398
399
y
400
401
z
402
x
403
404
y
405
406
z
407
x
408
409
y
410
411
z
412
x
413
414
y
415
416
z
417
x
418
419
y
420
421
z
422
x
423
424
y
425
426
z
427
x
428
429
y
430
431
z
432
x
433
434
y
435
436
z
437
x
438
439
y
440
441
z
442
x
443
444
y
445
446
z
447
x
448
449
y
450
451
z
452
x
453
454
y
455
456
z
457
wird
458
x
459
460
y
461
462
z
463
x
464
465
y
466
467
z
468
x
469
470
y
471
472
z
473
x
474
475
y
476
477
z
478
x
479
480
y
481
482
z
483
x
484
485
y
486
487
z
488
x
489
490
y
491
492
z
493
x
494
495
y
496
497
z
498
x
499
500
y
501
502
z
503
x
504
505
y
506
507
z
508
x
509
510
y
511
512
z
513
x
514
515
y
516
517
z
518
x
519
520
y
521
522
z
523
x
524
525
y
526
527
z
528
x
529
530
y
531
532
z
533
x
534
535
y
536
537
z
538
x
539
540
y
541
542
z
543
x
544
545
y
546
547
z
548
x
549
550
y
551
552
z
553
x
554
555
y
556
557
z
558
x
559
560
y
561
562
z
563
x
564
565
y
566
567
z
568
x
569
570
y
571
572
z
573
x
574
575
y
576
577
z
578
x
579
580
y
581
582
z
583
x
584
585
y
586
587
z
588
x
589
590
y
591
592
z
593
x
594
595
y
596
597
z
598
x
599
600
y
601
602
z
603
x
604
605
y
606
607
z
608
x
609
610
y
611
612
z
613
x
614
615
y
616
617
z
618
x
619
620
y
621
622
z
623
x
624
625
y
626
627
z
628
x
629
630
y
631
632
z
633
x
634
635
y
636
637
z
638
x
639
640
y
641
642
z
643
x
644
645
y
646
647
z
648
x
649
650
y
651
652
z
653
x
654
655
y
656
657
z
658
x
659
660
y
661
662
z
663
x
664
665
y
666
667
z
668
x
669
670
y
671
672
z
673
x
674
675
y
676
677
z
678
x
679
680
y
681
682
z
683
x
684
685
y
686
687
z
688
x
689
690
y
691
692
z
693
x
694
695
y
696
697
z
698
x
699
700
y
701
702
z
703
x
704
705
y
706
707
z
708
x
709
710
y
711
712
z
713
x
714
715
y
716
717
z
718
x
719
720
y
721
722
z
723
x
724
725
y
726
727
z
728
x
729
730
y
731
732
z
733
x
734
735
y
736
737
z
738
x
739
740
y
741
742
z
743
x
744
745
y
746
747
z
748
x
749
750
y
751
752
z
753
x
754
755
y
756
757
z
758
x
759
760
y
761
762
z
763
x
764
765
y
766
767
z
768
x
769
770
y
771
772
z
773
x
774
775
y
776
777
z
778
x
779
780
y
781
782
z
783
x
784
785
y
786
787
z
788
x
789
790
y
791
792
z
793
x
794
795
y
796
797
z
798
x
799
800
y
801
802
z
803
x
804
805
y
806
807
z
808
x
809
810
y
811
812
z
813
x
814
815
y
816
817
z
818
x
819
820
y
821
822
z
823
x
824
825
y
826
827
z
828
x
829
830
y
831
832
z
833
x
834
835
y
836
837
z
838
x
839
840
y
841
842
z
843
x
844
845
y
846
847
z
848
x
849
850
y
851
852
z
853
x
854
855
y
856
857
z
858
x
859
860
y
861
862
z
863
x
864
865
y
866
867
z
868
x
869
870
y
871
872
z
873
x
874
875
y
876
877
z
878
x
879
880
y
881
882
z
883
x
884
885
y
886
887
z
888
x
889
890
y
891
892
z
893
x
894
895
y
896
897
z
898
x
899
900
y
901
902
z
903
x
904
905
y
906
907
z
908
x
909
910
y
911
912
z
913
x
914
915
y
916
917
z
918
x
919
920
y
921
922
z
923
x
924
925
y
926
927
z
928
x
929
930
y
931
932
z
933
x
934
935
y
936
937
z
938
x
939
940
y
941
942
z
943
x
944
945
y
946
947
z
948
x
949
950
y
951
952
z
953
x
954
955
y
956
957
z
958
x
959
960
y
961
962
z
963
x
964
965
y
966
967
z
968
x
969
970
y
971
972
z
973
x
974
975
y
976
977
z
978
x
979
980
y
981
982
z
983
x
984
985
y
986
987
z
988
x
989
990
y
991
992
z
993
x
994
995
y
996
997
z
998
x
999
1000
y
1001
1002
z
1003
x
1004
1005
y
1006
1007
z
1008
x
1009
1010
y
1011
1012
z
1013
x
1014
1015
y
1016
1017
z
1018
x
1019
1020
y
1021
1022
z
1023
x
1024
1025
y
1026
1027
z
1028
x
1029
1030
y
1031
1032
z
1033
x
1034
1035
y
1036
1037
z
1038
x
1039
1040
y
1041
1042
z
1043
x
1044
1045
y
1046
1047
z
1048
x
1049
1050
y
1051
1052
z
1053
x
1054
1055
y
1056
1057
z
1058
x
1059
1060
y
1061
1062
z
1063
x
1064
1065
y
1066
1067
z
1068
x
1069
1070
y
1071
1072
z
1073
x
1074
1075
y
1076
1077
z
1078
x
1079
1080
y
1081
1082
z
1083
x
1084
1085
y
1086
1087
z
1088
x
1089
1090
y
1091
1092
z
1093
x
1094
1095
y
1096
1097
z
1098
x
1099
1100
y
1101
1102
z
1103
x
1104
1105
y
1106
1107
z
1108
x
1109
1110
y
1111
1112
z
1113
x
1114
1115
y
1116
1117
z
1118
x
1119
1120
y
1121
1122
z
1123
x
1124
1125
y
1126
1127
z
1128
x
1129
1130
y
1131
1132
z
1133
x
1134
1135
y
1136
1137
z
1138
x
1139
1140
y
1141
1142
z
1143
x
1144
1145
y
1146
1147
z
1148
x
1149
1150
y
1151
1152
z
1153
x
1154
1155
y
1156
1157
z
1158
x
1159
1160
y
1161
1162
z
1163
x
1164
1165
y
1166
1167
z
1168
x
1169
1170
y
1171
1172
z
1173
x
1174
1175
y
1176
1177
z
1178
x
1179
1180
y
1181
1182
z
1183
x
1184
1185
y
1186
1187
z
1188
x
1189
1190
y
1191
1192
z
1193
x
1194
1195
y
1196
1197
z
1198
x
1199
1200
y
1201
1202
z
1203
x
1204
1205
y
1206
1207
z
1208
x
1209
1210
y
1211
1212
z
1213
x
1214
1215
y
1216
1217
z
1218
x
1219
1220
y
1221
1222
z
1223
x
1224
1225
y
1226
1227
z
1228
x
1229
1230
y
1231
1232
z
1233
x
1234
1235
y
1236
1237
z
1238
x
1239
1240
y
1241
1242
z
1243
x
1244
1245
y
1246
1247
1248
z
1249
1250
\begin{knitrout}
1251
\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
1252
\begin{alltt}
1253
\hlkwd{summary}\hlstd{(}\hlkwd{rnorm}\hlstd{(}\hlnum{100}\hlstd{))}
1254
\end{alltt}
1255
\begin{verbatim}
1256
## Min. 1st Qu. Median Mean 3rd Qu. Max.
1257
## -1.967000 -0.668600 -0.005852 -0.013790 0.501400 2.685000
1258
\end{verbatim}
1259
\end{kframe}
1260
\end{knitrout}
1261
1262
THE END
1263
1264
\end{document}
1265