-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Report.tex
7457 lines (6241 loc) · 398 KB
/
Report.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\hypersetup{
pdftitle={Histopathology Research Template},
hidelinks,
pdfcreator={LaTeX via pandoc}}
\urlstyle{same} % disable monospaced font for URLs
\usepackage[margin=1in]{geometry}
\usepackage{color}
\usepackage{fancyvrb}
\newcommand{\VerbBar}{|}
\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\usepackage{framed}
\definecolor{shadecolor}{RGB}{255,255,255}
\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{0.75,0.01,0.01}{\textbf{\colorbox[rgb]{0.97,0.90,0.90}{#1}}}}
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.79,0.38,0.79}{#1}}
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.00,0.34,0.68}{#1}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.69,0.50,0.00}{#1}}
\newcommand{\BuiltInTok}[1]{\textcolor[rgb]{0.39,0.29,0.61}{\textbf{#1}}}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.57,0.30,0.62}{#1}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.54,0.53,0.53}{#1}}
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.00,0.58,1.00}{#1}}
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.67,0.33,0.00}{#1}}
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.12,0.11,0.11}{\textbf{#1}}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.00,0.34,0.68}{#1}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.69,0.50,0.00}{#1}}
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.38,0.47,0.50}{#1}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.75,0.01,0.01}{\underline{#1}}}
\newcommand{\ExtensionTok}[1]{\textcolor[rgb]{0.00,0.58,1.00}{\textbf{#1}}}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.69,0.50,0.00}{#1}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.39,0.29,0.61}{#1}}
\newcommand{\ImportTok}[1]{\textcolor[rgb]{1.00,0.33,0.00}{#1}}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.69,0.50,0.00}{#1}}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.12,0.11,0.11}{\textbf{#1}}}
\newcommand{\NormalTok}[1]{\textcolor[rgb]{0.12,0.11,0.11}{#1}}
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.12,0.11,0.11}{#1}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.43,0.16}{#1}}
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.00,0.43,0.16}{#1}}
\newcommand{\RegionMarkerTok}[1]{\textcolor[rgb]{0.00,0.34,0.68}{\colorbox[rgb]{0.88,0.91,0.97}{#1}}}
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.24,0.68,0.91}{#1}}
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{1.00,0.33,0.00}{#1}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.75,0.01,0.01}{#1}}
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.00,0.34,0.68}{#1}}
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.75,0.01,0.01}{#1}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.75,0.01,0.01}{#1}}
\usepackage{longtable,booktabs}
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
\usepackage{graphicx,grffile}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{5}
\usepackage{xcolor}
\definecolor{backgroundecho}{HTML}{cccccc}
\definecolor{textecho}{HTML}{333333}
\let\oldverbatim=\verbatim
\let\oldendverbatim=\endverbatim
\makeatletter
\renewenvironment{verbatim}{
\def\FrameCommand{
\hskip-\fboxsep
\color{textecho}
\colorbox{backgroundecho}
}
\MakeFramed{\@setminipage}
\oldverbatim
}
{
\oldendverbatim
\vskip-2em\@minipagefalse % The size required for this negative space is probably in some variable
\endMakeFramed
}
\makeatother
\usepackage{pdflscape}
\newcommand{\blandscape}{\begin{landscape}}
\newcommand{\elandscape}{\end{landscape}}
\usepackage{xcolor}
\usepackage{afterpage}
\renewcommand{\linethickness}{0.05em}
\usepackage{booktabs}
\usepackage{sectsty} \allsectionsfont{\nohang\centering \emph}
\usepackage{float}
\usepackage{svg}
\title{Histopathology Research Template}
\author{true}
\date{2020-02-26}
\begin{document}
\maketitle
{
\setcounter{tocdepth}{5}
\tableofcontents
}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\([![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3635430.svg)](https://doi.org/10.5281/zenodo.3635430)\)
\url{https://doi.org/10.5281/zenodo.3635430}
\url{https://osf.io/3tjfk/}
\href{https://sbalci.github.io/histopathology-template/}{Histopathology
Research Template 🔬}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\hypertarget{introduction}{%
\section{Introduction}\label{introduction}}
\begin{itemize}
\tightlist
\item
\textbf{State the marker of interest, the study objectives, and
hypotheses (Knijn, Simmer, and Nagtegaal 2015)}.\footnote{From Table
1: Proposed items for reporting histopathology studies.
Recommendations for reporting histopathology studies: a proposal
Virchows Arch (2015) 466:611--615 DOI 10.1007/s00428-015-1762-3
\url{https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4460276/}}
\end{itemize}
\hypertarget{materials-methods}{%
\section{Materials \& Methods}\label{materials-methods}}
\textbf{Describe Materials and Methods as highlighted in (Knijn, Simmer,
and Nagtegaal 2015)}.\footnote{From Table 1: Proposed items for
reporting histopathology studies. Recommendations for reporting
histopathology studies: a proposal Virchows Arch (2015) 466:611--615
DOI 10.1007/s00428-015-1762-3
\url{https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4460276/}}
\begin{itemize}
\item
Describe patient characteristics, and inclusion and exclusion criteria
\item
Describe treatment details
\item
Describe the type of material used
\item
Specify how expression of the biomarker was assessed
\item
Describe the number of independent (blinded) scorers and how they
scored
\item
State the method of case selection, study design, origin of the cases,
and time frame
\item
Describe the end of the follow-up period and median follow-up time
\item
Define all clinical endpoints examined
\item
Specify all applied statistical methods
\item
Describe how interactions with other clinical/pathological factors
were analyzed
\end{itemize}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\hypertarget{header-codes}{%
\subsection{Header Codes}\label{header-codes}}
\textbf{Codes for general settings.}\footnote{See
\href{https://github.com/sbalci/histopathology-template/blob/master/childRmd/_01header.Rmd}{\texttt{childRmd/\_01header.Rmd}}
file for other general settings}
\textbf{Setup global chunk settings}\footnote{Change
\texttt{echo\ =\ FALSE} to hide codes after knitting and Change
\texttt{cache\ =\ TRUE} to knit quickly. Change \texttt{error=TRUE} to
continue rendering while errors are present.}
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{knitr}\OperatorTok{::}\NormalTok{opts_chunk}\OperatorTok{$}\KeywordTok{set}\NormalTok{(}
\DataTypeTok{eval =} \OtherTok{TRUE}\NormalTok{,}
\DataTypeTok{echo =} \OtherTok{TRUE}\NormalTok{,}
\DataTypeTok{fig.path =}\NormalTok{ here}\OperatorTok{::}\KeywordTok{here}\NormalTok{(}\StringTok{"figs/"}\NormalTok{),}
\DataTypeTok{message =} \OtherTok{FALSE}\NormalTok{,}
\DataTypeTok{warning =} \OtherTok{FALSE}\NormalTok{,}
\DataTypeTok{error =} \OtherTok{TRUE}\NormalTok{,}
\DataTypeTok{cache =} \OtherTok{TRUE}\NormalTok{,}
\DataTypeTok{comment =} \OtherTok{NA}\NormalTok{,}
\DataTypeTok{tidy =} \OtherTok{TRUE}\NormalTok{,}
\DataTypeTok{fig.width =} \DecValTok{6}\NormalTok{,}
\DataTypeTok{fig.height =} \DecValTok{4}
\NormalTok{)}
\end{Highlighting}
\end{Shaded}
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{library}\NormalTok{(knitr)}
\NormalTok{hook_output =}\StringTok{ }\NormalTok{knit_hooks}\OperatorTok{$}\KeywordTok{get}\NormalTok{(}\StringTok{"output"}\NormalTok{)}
\NormalTok{knit_hooks}\OperatorTok{$}\KeywordTok{set}\NormalTok{(}\DataTypeTok{output =} \ControlFlowTok{function}\NormalTok{(x, options) \{}
\CommentTok{# this hook is used only when the linewidth option is not NULL}
\ControlFlowTok{if}\NormalTok{ (}\OperatorTok{!}\KeywordTok{is.null}\NormalTok{(n <-}\StringTok{ }\NormalTok{options}\OperatorTok{$}\NormalTok{linewidth)) \{}
\NormalTok{ x =}\StringTok{ }\NormalTok{knitr}\OperatorTok{:::}\KeywordTok{split_lines}\NormalTok{(x)}
\CommentTok{# any lines wider than n should be wrapped}
\ControlFlowTok{if}\NormalTok{ (}\KeywordTok{any}\NormalTok{(}\KeywordTok{nchar}\NormalTok{(x) }\OperatorTok{>}\StringTok{ }\NormalTok{n)) }
\NormalTok{ x =}\StringTok{ }\KeywordTok{strwrap}\NormalTok{(x, }\DataTypeTok{width =}\NormalTok{ n)}
\NormalTok{ x =}\StringTok{ }\KeywordTok{paste}\NormalTok{(x, }\DataTypeTok{collapse =} \StringTok{"}\CharTok{\textbackslash{}n}\StringTok{"}\NormalTok{)}
\NormalTok{ \}}
\KeywordTok{hook_output}\NormalTok{(x, options)}
\NormalTok{\})}
\end{Highlighting}
\end{Shaded}
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{# linewidth css}
\NormalTok{ pre}\InformationTok{:not(}\ExtensionTok{[class]}\InformationTok{)}\NormalTok{ \{}
\KeywordTok{color}\NormalTok{: }\ConstantTok{#333333}\OperatorTok{;}
\KeywordTok{background-color}\NormalTok{: }\ConstantTok{#cccccc}\OperatorTok{;}
\NormalTok{ \}}
\end{Highlighting}
\end{Shaded}
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{# linewidth css}
\end{Highlighting}
\end{Shaded}
\textbf{Load Library}
see
\href{https://github.com/sbalci/histopathology-template/blob/master/R/loadLibrary.R}{\texttt{R/loadLibrary.R}}
for the libraries loaded.
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{source}\NormalTok{(}\DataTypeTok{file =}\NormalTok{ here}\OperatorTok{::}\KeywordTok{here}\NormalTok{(}\StringTok{"R"}\NormalTok{, }\StringTok{"loadLibrary.R"}\NormalTok{))}
\end{Highlighting}
\end{Shaded}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\hypertarget{generate-fake-data}{%
\subsection{Generate Fake Data}\label{generate-fake-data}}
\textbf{Codes for generating fake data}.\footnote{See
\href{https://github.com/sbalci/histopathology-template/blob/master/childRmd/_02fakeData.Rmd}{\texttt{childRmd/\_02fakeData.Rmd}}
file for other codes}
\textbf{Generate Fake Data}
This code generates a fake histopathological data. Some sources for fake
data generation here\footnote{Synthea The validity of synthetic clinical
data: a validation study of a leading synthetic data generator
(Synthea) using clinical quality measures. BMC Med Inform Decis Mak
19, 44 (2019) \url{doi:10.1186/s12911-019-0793-0}} , here\footnote{\url{https://bmcmedinformdecismak.biomedcentral.com/articles/10.1186/s12911-019-0793-0}}
, here\footnote{\href{https://synthetichealth.github.io/synthea/}{Synthetic
Patient Generation}} , here\footnote{\href{https://github.com/synthetichealth/synthea/wiki/Basic-Setup-and-Running}{Basic
Setup and Running}} , here\footnote{\href{http://www.mli.gmu.edu/index.php/research/ipdg/}{intelligent
patient data generator (iPDG)}} , here\footnote{\url{https://medium.com/free-code-camp/how-our-test-data-generator-makes-fake-data-look-real-ace01c5bde4a}}
, here\footnote{\url{https://forums.librehealth.io/t/demo-data-generation/203}}
, here\footnote{\url{https://mihin.org/services/patient-generator/}} ,
and here\footnote{lung, cancer, breast datası ile birleştir} .
\textbf{Use
\href{https://github.com/sbalci/histopathology-template/blob/master/R/gc_fake_data.R}{this
code} to generate fake clinicopathologic data}
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{source}\NormalTok{(}\DataTypeTok{file =}\NormalTok{ here}\OperatorTok{::}\KeywordTok{here}\NormalTok{(}\StringTok{"R"}\NormalTok{, }\StringTok{"gc_fake_data.R"}\NormalTok{))}
\end{Highlighting}
\end{Shaded}
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{wakefield}\OperatorTok{::}\KeywordTok{table_heat}\NormalTok{(}\DataTypeTok{x =}\NormalTok{ fakedata, }\DataTypeTok{palette =} \StringTok{"Set1"}\NormalTok{, }\DataTypeTok{flip =} \OtherTok{TRUE}\NormalTok{, }\DataTypeTok{print =} \OtherTok{TRUE}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
\includegraphics{/Users/serdarbalciold/histopathRprojects/histopathology-template/figs/plot fake data-1.pdf}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\hypertarget{import-data}{%
\subsection{Import Data}\label{import-data}}
\textbf{Codes for importing data.}\footnote{See
\href{https://github.com/sbalci/histopathology-template/blob/master/childRmd/_03importData.Rmd}{\texttt{childRmd/\_03importData.Rmd}}
file for other codes}
\textbf{Read the data}
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{library}\NormalTok{(readxl)}
\NormalTok{mydata <-}\StringTok{ }\NormalTok{readxl}\OperatorTok{::}\KeywordTok{read_excel}\NormalTok{(here}\OperatorTok{::}\KeywordTok{here}\NormalTok{(}\StringTok{"data"}\NormalTok{, }\StringTok{"mydata.xlsx"}\NormalTok{))}
\CommentTok{# View(mydata) # Use to view data after importing}
\end{Highlighting}
\end{Shaded}
Add code for import multiple data purrr reduce
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\hypertarget{study-population}{%
\subsection{Study Population}\label{study-population}}
\hypertarget{report-general-features}{%
\subsubsection{Report General Features}\label{report-general-features}}
\textbf{Codes for reporting general features.}\footnote{See
\href{https://github.com/sbalci/histopathology-template/blob/master/childRmd/_04briefSummary.Rmd}{\texttt{childRmd/\_04briefSummary.Rmd}}
file for other codes}
\textbf{Dataframe Report}
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{# Dataframe report}
\NormalTok{mydata }\OperatorTok{%>%}\StringTok{ }\NormalTok{dplyr}\OperatorTok{::}\KeywordTok{select}\NormalTok{(}\OperatorTok{-}\KeywordTok{contains}\NormalTok{(}\StringTok{"Date"}\NormalTok{)) }\OperatorTok{%>%}\StringTok{ }\NormalTok{report}\OperatorTok{::}\KeywordTok{report}\NormalTok{(.)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
The data contains 250 observations of the following variables:
- ID: 250 entries: 001, n = 1; 002, n = 1; 003, n = 1 and 247 others (0 missing)
- Name: 249 entries: Aadan, n = 1; Aadhyan, n = 1; Abduljaleel, n = 1 and 246 others (1 missing)
- Sex: 2 entries: Male, n = 134; Female, n = 115 (1 missing)
- Age: Mean = 48.99, SD = 14.44, Median = , MAD = 19.27, range: [25, 73], Skewness = 0.03, Kurtosis = -1.28, 1 missing
- Race: 7 entries: White, n = 167; Hispanic, n = 36; Black, n = 23 and 4 others (1 missing)
- PreinvasiveComponent: 2 entries: Absent, n = 194; Present, n = 55 (1 missing)
- LVI: 2 entries: Absent, n = 166; Present, n = 84 (0 missing)
- PNI: 2 entries: Absent, n = 165; Present, n = 84 (1 missing)
- Death: 2 levels: FALSE (n = 69, 27.60%); TRUE (n = 180, 72.00%) and missing (n = 1, 0.40%)
- Group: 2 entries: Treatment, n = 129; Control, n = 120 (1 missing)
- Grade: 3 entries: 3, n = 110; 2, n = 79; 1, n = 60 (1 missing)
- TStage: 4 entries: 4, n = 117; 2, n = 58; 3, n = 53 and 1 other (1 missing)
- AntiX_intensity: Mean = 2.42, SD = 0.64, Median = , MAD = 0.00, range: [1, 3], Skewness = -0.67, Kurtosis = -0.57, 1 missing
- AntiY_intensity: Mean = 2.07, SD = 0.77, Median = , MAD = 1.48, range: [1, 3], Skewness = -0.12, Kurtosis = -1.29, 1 missing
- LymphNodeMetastasis: 2 entries: Absent, n = 155; Present, n = 94 (1 missing)
- Valid: 2 levels: FALSE (n = 135, 54.00%); TRUE (n = 114, 45.60%) and missing (n = 1, 0.40%)
- Smoker: 2 levels: FALSE (n = 132, 52.80%); TRUE (n = 117, 46.80%) and missing (n = 1, 0.40%)
- Grade_Level: 3 entries: high, n = 103; moderate, n = 78; low, n = 68 (1 missing)
- DeathTime: 2 entries: Within1Year, n = 148; MoreThan1Year, n = 102 (0 missing)
\end{verbatim}
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{mydata }\OperatorTok{%>%}\StringTok{ }\NormalTok{explore}\OperatorTok{::}\KeywordTok{describe_tbl}\NormalTok{()}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
250 observations with 21 variables
18 variables containing missings (NA)
0 variables with no variance
\end{verbatim}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\hypertarget{ethics-and-irb}{%
\subsection{Ethics and IRB}\label{ethics-and-irb}}
\hypertarget{always-respect-patient-privacy}{%
\subsubsection{Always Respect Patient
Privacy}\label{always-respect-patient-privacy}}
\textbf{Always Respect Patient Privacy}\\
- Health Information Privacy\footnote{\url{https://www.hhs.gov/hipaa/index.html}}~\\
- Kişisel Verilerin Korunması\footnote{\href{https://barandogan.av.tr/blog/ceza-hukuku/kisisel-verilerin-ele-gecirilmesi-yayilmasi-baskasina-verilmesi-sucu.html}{Kişisel
verilerin kaydedilmesi ve kişisel verileri hukuka aykırı olarak verme
veya ele geçirme Türk Ceza Kanunu'nun 135. ve 136. maddesi kapsamında
bizim hukuk sistemimizde suç olarak tanımlanmıştır. Kişisel verilerin
kaydedilmesi suçunun cezası 1 ila 3 yıl hapis cezasıdır. Suçun
nitelikli hali ise, kamu görevlisi tarafından görevin verdiği yetkinin
kötüye kullanılarak veya belirli bir meslek veya sanatın sağladığı
kolaylıktan yararlanılarak işlenmesidir ki bu durumda suçun cezası 1.5
ile 4.5 yıl hapis cezası olacaktır.}}
\noindent
\colorbox{yellow}{
\parbox{\dimexpr\linewidth-2\fboxsep}{
**Always Respect Patient Privacy**
- Health Information Privacy^[https://www.hhs.gov/hipaa/index.html]
- Kişisel Verilerin Korunması^[[Kişisel verilerin kaydedilmesi ve kişisel verileri hukuka aykırı olarak verme veya ele geçirme Türk Ceza Kanunu'nun 135. ve 136. maddesi kapsamında bizim hukuk sistemimizde suç olarak tanımlanmıştır. Kişisel verilerin kaydedilmesi suçunun cezası 1 ila 3 yıl hapis cezasıdır. Suçun nitelikli hali ise, kamu görevlisi tarafından görevin verdiği yetkinin kötüye kullanılarak veya belirli bir meslek veya sanatın sağladığı kolaylıktan yararlanılarak işlenmesidir ki bu durumda suçun cezası 1.5 ile 4.5 yıl hapis cezası olacaktır.](https://barandogan.av.tr/blog/ceza-hukuku/kisisel-verilerin-ele-gecirilmesi-yayilmasi-baskasina-verilmesi-sucu.html)]
}
}
\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}
\hypertarget{define-variable-types}{%
\subsection{Define Variable Types}\label{define-variable-types}}
\textbf{Codes for defining variable types}.\footnote{See
\href{https://github.com/sbalci/histopathology-template/blob/master/childRmd/_06variableTypes.Rmd}{\texttt{childRmd/\_06variableTypes.Rmd}}
file for other codes}
\textbf{print column names as vector}
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{dput}\NormalTok{(}\KeywordTok{names}\NormalTok{(mydata))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
c("ID", "Name", "Sex", "Age", "Race", "PreinvasiveComponent",
"LVI", "PNI", "LastFollowUpDate", "Death", "Group", "Grade",
"TStage", "AntiX_intensity", "AntiY_intensity", "LymphNodeMetastasis",
"Valid", "Smoker", "Grade_Level", "SurgeryDate", "DeathTime")
\end{verbatim}
\hypertarget{find-key-columns}{%
\subsubsection{Find Key Columns}\label{find-key-columns}}
\hypertarget{find-id-and-key-columns-to-exclude-from-analysis}{%
\paragraph{Find ID and key columns to exclude from
analysis}\label{find-id-and-key-columns-to-exclude-from-analysis}}
\begin{verbatim}
vctrs::vec_assert()
dplyr::all_equal()
arsenal::compare()
visdat::vis_compare()
\end{verbatim}
See the code as function in
\href{https://github.com/sbalci/histopathology-template/blob/master/R/find_key.R}{\texttt{R/find\_key.R}}.
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{keycolumns <-}\StringTok{ }\NormalTok{mydata }\OperatorTok{%>%}\StringTok{ }\KeywordTok{sapply}\NormalTok{(., }\DataTypeTok{FUN =}\NormalTok{ dataMaid}\OperatorTok{::}\NormalTok{isKey) }\OperatorTok{%>%}\StringTok{ }\NormalTok{tibble}\OperatorTok{::}\KeywordTok{as_tibble}\NormalTok{() }\OperatorTok{%>%}\StringTok{ }
\StringTok{ }\NormalTok{dplyr}\OperatorTok{::}\KeywordTok{select}\NormalTok{(}\KeywordTok{which}\NormalTok{(.[}\DecValTok{1}\NormalTok{, ] }\OperatorTok{==}\StringTok{ }\OtherTok{TRUE}\NormalTok{)) }\OperatorTok{%>%}\StringTok{ }\KeywordTok{names}\NormalTok{()}
\NormalTok{keycolumns}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
[1] "ID" "Name"
\end{verbatim}
\hypertarget{variable-types}{%
\subsubsection{Variable Types}\label{variable-types}}
\textbf{Get variable types}
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{mydata }\OperatorTok{%>%}\StringTok{ }\NormalTok{dplyr}\OperatorTok{::}\KeywordTok{select}\NormalTok{(}\OperatorTok{-}\NormalTok{keycolumns) }\OperatorTok{%>%}\StringTok{ }\NormalTok{inspectdf}\OperatorTok{::}\KeywordTok{inspect_types}\NormalTok{()}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
# A tibble: 4 x 4
type cnt pcnt col_name
<chr> <int> <dbl> <list>
1 character 11 57.9 <chr [11]>
2 logical 3 15.8 <chr [3]>
3 numeric 3 15.8 <chr [3]>
4 POSIXct POSIXt 2 10.5 <chr [2]>
\end{verbatim}
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{mydata }\OperatorTok{%>%}\StringTok{ }\NormalTok{dplyr}\OperatorTok{::}\KeywordTok{select}\NormalTok{(}\OperatorTok{-}\NormalTok{keycolumns, }\OperatorTok{-}\KeywordTok{contains}\NormalTok{(}\StringTok{"Date"}\NormalTok{)) }\OperatorTok{%>%}\StringTok{ }\NormalTok{describer}\OperatorTok{::}\KeywordTok{describe}\NormalTok{() }\OperatorTok{%>%}\StringTok{ }
\StringTok{ }\NormalTok{knitr}\OperatorTok{::}\KeywordTok{kable}\NormalTok{(}\DataTypeTok{format =} \StringTok{"markdown"}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
\begin{longtable}[]{@{}lllrrrlrrrl@{}}
\toprule
\begin{minipage}[b]{0.10\columnwidth}\raggedright
.column\_name\strut
\end{minipage} & \begin{minipage}[b]{0.07\columnwidth}\raggedright
.column\_class\strut
\end{minipage} & \begin{minipage}[b]{0.06\columnwidth}\raggedright
.column\_type\strut
\end{minipage} & \begin{minipage}[b]{0.08\columnwidth}\raggedleft
.count\_elements\strut
\end{minipage} & \begin{minipage}[b]{0.06\columnwidth}\raggedleft
.mean\_value\strut
\end{minipage} & \begin{minipage}[b]{0.05\columnwidth}\raggedleft
.sd\_value\strut
\end{minipage} & \begin{minipage}[b]{0.07\columnwidth}\raggedright
.q0\_value\strut
\end{minipage} & \begin{minipage}[b]{0.05\columnwidth}\raggedleft
.q25\_value\strut
\end{minipage} & \begin{minipage}[b]{0.05\columnwidth}\raggedleft
.q50\_value\strut
\end{minipage} & \begin{minipage}[b]{0.05\columnwidth}\raggedleft
.q75\_value\strut
\end{minipage} & \begin{minipage}[b]{0.06\columnwidth}\raggedright
.q100\_value\strut
\end{minipage}\tabularnewline
\midrule
\endhead
\begin{minipage}[t]{0.10\columnwidth}\raggedright
Sex\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
Female\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
Male\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.10\columnwidth}\raggedright
Age\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
numeric\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
double\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
48.991968\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
14.4417607\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
25\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
36\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
50\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
62\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
73\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.10\columnwidth}\raggedright
Race\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
Asian\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
White\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.10\columnwidth}\raggedright
PreinvasiveComponent\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
Absent\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
Present\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.10\columnwidth}\raggedright
LVI\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
Absent\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
Present\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.10\columnwidth}\raggedright
PNI\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
Absent\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
Present\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.10\columnwidth}\raggedright
Death\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
logical\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
logical\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
FALSE\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
TRUE\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.10\columnwidth}\raggedright
Group\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
Control\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
Treatment\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.10\columnwidth}\raggedright
Grade\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
1\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
3\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.10\columnwidth}\raggedright
TStage\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
1\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
4\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.10\columnwidth}\raggedright
AntiX\_intensity\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
numeric\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
double\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
2.421687\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
0.6435878\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
1\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
2\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
3\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
3\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
3\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.10\columnwidth}\raggedright
AntiY\_intensity\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
numeric\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
double\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
2.068273\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
0.7668520\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
1\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
1\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
2\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
3\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
3\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.10\columnwidth}\raggedright
LymphNodeMetastasis\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
Absent\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
Present\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.10\columnwidth}\raggedright
Valid\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
logical\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
logical\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
FALSE\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
TRUE\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.10\columnwidth}\raggedright
Smoker\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
logical\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
logical\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
FALSE\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
TRUE\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.10\columnwidth}\raggedright
Grade\_Level\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
high\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
moderate\strut
\end{minipage}\tabularnewline
\begin{minipage}[t]{0.10\columnwidth}\raggedright
DeathTime\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
character\strut
\end{minipage} & \begin{minipage}[t]{0.08\columnwidth}\raggedleft
250\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.07\columnwidth}\raggedright
MoreThan1Year\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.05\columnwidth}\raggedleft
NA\strut
\end{minipage} & \begin{minipage}[t]{0.06\columnwidth}\raggedright
Within1Year\strut
\end{minipage}\tabularnewline
\bottomrule
\end{longtable}
\textbf{Plot variable types}
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{mydata }\OperatorTok{%>%}\StringTok{ }\NormalTok{dplyr}\OperatorTok{::}\KeywordTok{select}\NormalTok{(}\OperatorTok{-}\NormalTok{keycolumns) }\OperatorTok{%>%}\StringTok{ }\NormalTok{inspectdf}\OperatorTok{::}\KeywordTok{inspect_types}\NormalTok{() }\OperatorTok{%>%}\StringTok{ }\NormalTok{inspectdf}\OperatorTok{::}\KeywordTok{show_plot}\NormalTok{()}
\end{Highlighting}
\end{Shaded}
\includegraphics{/Users/serdarbalciold/histopathRprojects/histopathology-template/figs/variable type plot inspectdf-1.pdf}
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{# https://github.com/ropensci/visdat}
\CommentTok{# http://visdat.njtierney.com/articles/using_visdat.html}
\CommentTok{# https://cran.r-project.org/web/packages/visdat/index.html}
\CommentTok{# http://visdat.njtierney.com/}
\CommentTok{# visdat::vis_guess(mydata)}
\NormalTok{visdat}\OperatorTok{::}\KeywordTok{vis_dat}\NormalTok{(mydata)}
\end{Highlighting}
\end{Shaded}
\includegraphics{/Users/serdarbalciold/histopathRprojects/histopathology-template/figs/variable type plot visdat-1.pdf}
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{mydata }\OperatorTok{%>%}\StringTok{ }\NormalTok{explore}\OperatorTok{::}\KeywordTok{explore_tbl}\NormalTok{()}
\end{Highlighting}
\end{Shaded}
\includegraphics{/Users/serdarbalciold/histopathRprojects/histopathology-template/figs/variable type plot explore-1.pdf}
\hypertarget{define-variable-types-1}{%
\subsubsection{Define Variable Types}\label{define-variable-types-1}}
\hypertarget{find-character-variables}{%
\paragraph{\texorpdfstring{Find \texttt{character}
variables}{Find character variables}}\label{find-character-variables}}
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{characterVariables <-}\StringTok{ }\NormalTok{mydata }\OperatorTok{%>%}\StringTok{ }\NormalTok{dplyr}\OperatorTok{::}\KeywordTok{select}\NormalTok{(}\OperatorTok{-}\NormalTok{keycolumns) }\OperatorTok{%>%}\StringTok{ }\NormalTok{inspectdf}\OperatorTok{::}\KeywordTok{inspect_types}\NormalTok{() }\OperatorTok{%>%}\StringTok{ }
\StringTok{ }\NormalTok{dplyr}\OperatorTok{::}\KeywordTok{filter}\NormalTok{(type }\OperatorTok{==}\StringTok{ "character"}\NormalTok{) }\OperatorTok{%>%}\StringTok{ }\NormalTok{dplyr}\OperatorTok{::}\KeywordTok{select}\NormalTok{(col_name) }\OperatorTok{%>%}\StringTok{ }\NormalTok{dplyr}\OperatorTok{::}\KeywordTok{pull}\NormalTok{() }\OperatorTok{%>%}\StringTok{ }
\StringTok{ }\KeywordTok{unlist}\NormalTok{()}
\NormalTok{characterVariables}
\end{Highlighting}