This function takes a DescrList object and converts it to either a DescrPrintCharacter or DescrPrintNumeric object, depending on the print_format option. This object is then printed in an appropriate format.
Arguments
- x
A
DescrList
object returned fromdescr
.- print_format
Possible values: "console" (default), "tex", "html", "word", "numeric"
- silent
I TRUE, suppresses output to stdout.
- ...
further arguments to be passed along to print method
Value
A DescrPrint object which can be printed in various formats.
You can use the print_format
option to control the output type. If you use 'DescrTab2' inside an .Rmd document,
you can set the clobal option option(print_format="tex")
or option(print_format="html")
or
option(print_format="word")
depending on your document type. This way, all your tables will be printed in the
right format by default inside this document.
Details
There is no way to convert between DescrPrintCharacter and DescrPrintNumeric objects. The first type is for what you would usually want, the second type is mostly for debugging purposes. A DescrPrintCharacter object can be printed as html, tex code, as a flextable object or simply to the console.
Examples
print(descr(iris), print_format = "console")
#> Variable Totl p Test
#> 1 Sp.L
#> 2 N 150 <0.001 tt1
#> 3 mean 5.84
#> 4 sd 0.828
#> 5 median 5.8
#> 6 Q1 - Q3 5.1 -- 6.4
#> 7 min - max 4.3 -- 7.9
#> 8 Sp.W
#> 9 N 150 <0.001 tt1
#> 10 mean 3.06
#> 11 sd 0.436
#> 12 median 3
#> 13 Q1 - Q3 2.8 -- 3.3
#> 14 min - max 2 -- 4.4
#> 15 Pt.L
#> 16 N 150 <0.001 tt1
#> 17 mean 3.76
#> 18 sd 1.77
#> 19 median 4.35
#> 20 Q1 - Q3 1.6 -- 5.1
#> 21 min - max 1 -- 6.9
#> 22 Pt.W
#> 23 N 150 <0.001 tt1
#> 24 mean 1.2
#> 25 sd 0.762
#> 26 median 1.3
#> 27 Q1 - Q3 0.3 -- 1.8
#> 28 min - max 0.1 -- 2.5
#> 29 Spcs
#> 30 sets 50 (33.3%) >0.999 chi1
#> 31 vrsc 50 (33.3%)
#> 32 vrgn 50 (33.3%)
print(descr(iris), print_format = "tex")
#> \needspace{2cm}
#>
#> \begin{longtable}[t]{>{\raggedright\arraybackslash}p{7em}cc}
#> \toprule
#> \multicolumn{1}{l}{Variable} & \multicolumn{1}{c}{Total} & \multicolumn{1}{c}{p} \\*
#> & (N=150) & \\*
#> \midrule
#> \endfirsthead
#> \multicolumn{3}{@{}l}{\textit{(continued)}}\\*
#> \toprule
#> \multicolumn{1}{l}{Variable} & \multicolumn{1}{c}{Total} & \multicolumn{1}{c}{p} \\*
#> & (N=150) & \\*
#> \midrule
#> \endhead
#>
#> \endfoot
#>
#> \endlastfoot
#> \addlinespace[0.5cm]
#> \multicolumn{3}{l}{\textbf{\begin{minipage}[t]{7em}\raggedright Sepal.Length\end{minipage}}}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}N\vspace{0.75ex}\end{minipage} & 150 & \vphantom{3} \textless0.001\textsuperscript{tt1}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}mean\vspace{0.75ex}\end{minipage} & 5.84 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}sd\vspace{0.75ex}\end{minipage} & 0.828 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}median\vspace{0.75ex}\end{minipage} & 5.8 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}Q1 - Q3\vspace{0.75ex}\end{minipage} & 5.1 -- 6.4 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}min - max\vspace{0.75ex}\end{minipage} & 4.3 -- 7.9 & \\ \noalign{\vskip 0pt plus 12pt}
#> \addlinespace[0.5cm]
#> \multicolumn{3}{l}{\textbf{\begin{minipage}[t]{7em}\raggedright Sepal.Width\end{minipage}}}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}N\vspace{0.75ex}\end{minipage} & 150 & \vphantom{2} \textless0.001\textsuperscript{tt1}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}mean\vspace{0.75ex}\end{minipage} & 3.06 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}sd\vspace{0.75ex}\end{minipage} & 0.436 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}median\vspace{0.75ex}\end{minipage} & 3 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}Q1 - Q3\vspace{0.75ex}\end{minipage} & 2.8 -- 3.3 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}min - max\vspace{0.75ex}\end{minipage} & 2 -- 4.4 & \\ \noalign{\vskip 0pt plus 12pt}
#> \addlinespace[0.5cm]
#> \multicolumn{3}{l}{\textbf{\begin{minipage}[t]{7em}\raggedright Petal.Length\end{minipage}}}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}N\vspace{0.75ex}\end{minipage} & 150 & \vphantom{1} \textless0.001\textsuperscript{tt1}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}mean\vspace{0.75ex}\end{minipage} & 3.76 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}sd\vspace{0.75ex}\end{minipage} & 1.77 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}median\vspace{0.75ex}\end{minipage} & 4.35 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}Q1 - Q3\vspace{0.75ex}\end{minipage} & 1.6 -- 5.1 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}min - max\vspace{0.75ex}\end{minipage} & 1 -- 6.9 & \\ \noalign{\vskip 0pt plus 12pt}
#> \addlinespace[0.5cm]
#> \multicolumn{3}{l}{\textbf{\begin{minipage}[t]{7em}\raggedright Petal.Width\end{minipage}}}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}N\vspace{0.75ex}\end{minipage} & 150 & \textless0.001\textsuperscript{tt1}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}mean\vspace{0.75ex}\end{minipage} & 1.2 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}sd\vspace{0.75ex}\end{minipage} & 0.762 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}median\vspace{0.75ex}\end{minipage} & 1.3 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}Q1 - Q3\vspace{0.75ex}\end{minipage} & 0.3 -- 1.8 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}min - max\vspace{0.75ex}\end{minipage} & 0.1 -- 2.5 & \\ \noalign{\vskip 0pt plus 12pt} \pagebreak[3]
#> \addlinespace[0.5cm]
#> \multicolumn{3}{l}{\textbf{\begin{minipage}[t]{7em}\raggedright Species\end{minipage}}}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}setosa\vspace{0.75ex}\end{minipage} & 50 (33.3\%) & \textgreater0.999\textsuperscript{chi1}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}versicolor\vspace{0.75ex}\end{minipage} & 50 (33.3\%) & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}virginica\vspace{0.75ex}\end{minipage} & 50 (33.3\%) & \\*
#> \bottomrule
#> \multicolumn{3}{l}{\rule{0pt}{1em}\textsuperscript{tt1} Student's one-sample t-test}\\*
#> \multicolumn{3}{l}{\rule{0pt}{1em}\textsuperscript{chi1} Chi-squared goodness-of-fit test}\\*
#> \end{longtable}
print(descr(iris), print_format = "html")
#> <table class="table" style="margin-left: auto; margin-right: auto;border-bottom: 0;">
#> <thead>
#> <tr>
#> <th style="border-bottom:hidden;padding-bottom:0; padding-left:3px;padding-right:3px;text-align: left; " colspan="1"><div style="">Variable</div></th>
#> <th style="border-bottom:hidden;padding-bottom:0; padding-left:3px;padding-right:3px;text-align: center; " colspan="1"><div style="">Total</div></th>
#> <th style="border-bottom:hidden;padding-bottom:0; padding-left:3px;padding-right:3px;text-align: center; " colspan="1"><div style="">p</div></th>
#> </tr>
#> <tr>
#> <th style="text-align:left;"> </th>
#> <th style="text-align:center;"> (N=150) </th>
#> <th style="text-align:center;"> </th>
#> </tr>
#> </thead>
#> <tbody>
#> <tr grouplength="6"><td colspan="3" style="border-bottom: 1px solid;"><strong>Sepal.Length</strong></td></tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> N </td>
#> <td style="text-align:center;"> 150 </td>
#> <td style="text-align:center;"> tt1 </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> mean </td>
#> <td style="text-align:center;"> 5.84 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> sd </td>
#> <td style="text-align:center;"> 0.828 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> median </td>
#> <td style="text-align:center;"> 5.8 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> Q1 - Q3 </td>
#> <td style="text-align:center;"> 5.1 -- 6.4 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> min - max </td>
#> <td style="text-align:center;"> 4.3 -- 7.9 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr grouplength="6"><td colspan="3" style="border-bottom: 1px solid;"><strong>Sepal.Width</strong></td></tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> N </td>
#> <td style="text-align:center;"> 150 </td>
#> <td style="text-align:center;"> tt1 </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> mean </td>
#> <td style="text-align:center;"> 3.06 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> sd </td>
#> <td style="text-align:center;"> 0.436 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> median </td>
#> <td style="text-align:center;"> 3 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> Q1 - Q3 </td>
#> <td style="text-align:center;"> 2.8 -- 3.3 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> min - max </td>
#> <td style="text-align:center;"> 2 -- 4.4 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr grouplength="6"><td colspan="3" style="border-bottom: 1px solid;"><strong>Petal.Length</strong></td></tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> N </td>
#> <td style="text-align:center;"> 150 </td>
#> <td style="text-align:center;"> tt1 </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> mean </td>
#> <td style="text-align:center;"> 3.76 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> sd </td>
#> <td style="text-align:center;"> 1.77 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> median </td>
#> <td style="text-align:center;"> 4.35 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> Q1 - Q3 </td>
#> <td style="text-align:center;"> 1.6 -- 5.1 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> min - max </td>
#> <td style="text-align:center;"> 1 -- 6.9 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr grouplength="6"><td colspan="3" style="border-bottom: 1px solid;"><strong>Petal.Width</strong></td></tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> N </td>
#> <td style="text-align:center;"> 150 </td>
#> <td style="text-align:center;"> tt1 </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> mean </td>
#> <td style="text-align:center;"> 1.2 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> sd </td>
#> <td style="text-align:center;"> 0.762 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> median </td>
#> <td style="text-align:center;"> 1.3 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> Q1 - Q3 </td>
#> <td style="text-align:center;"> 0.3 -- 1.8 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> min - max </td>
#> <td style="text-align:center;"> 0.1 -- 2.5 </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr grouplength="3"><td colspan="3" style="border-bottom: 1px solid;"><strong>Species</strong></td></tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> setosa </td>
#> <td style="text-align:center;"> 50 (33.3%) </td>
#> <td style="text-align:center;"> >0.999<sup>chi1</sup> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> versicolor </td>
#> <td style="text-align:center;"> 50 (33.3%) </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> <tr>
#> <td style="text-align:left;width: 4.2cm; padding-left: 2em;" indentlevel="1"> virginica </td>
#> <td style="text-align:center;"> 50 (33.3%) </td>
#> <td style="text-align:center;"> </td>
#> </tr>
#> </tbody>
#> <tfoot>
#> <tr><td style="padding: 0; " colspan="100%">
#> <sup>tt1</sup> Student's one-sample t-test</td></tr>
#> <tr><td style="padding: 0; " colspan="100%">
#> <sup>chi1</sup> Chi-squared goodness-of-fit test</td></tr>
#> </tfoot>
#> </table>
print(descr(iris), print_format = "word")
print(descr(iris), print_format = "numeric")
#> # A tibble: 44 × 4
#> Variable Total p Test
#> <chr> <dbl> <dbl> <chr>
#> 1 Sepal.Length 3.33e-129 Student's one-sample t-test
#> 2 N 150
#> 3 Nmiss 0
#> 4 mean 5.84
#> 5 sd 0.828
#> 6 median 5.8
#> 7 Q1 5.1
#> 8 Q3 6.4
#> 9 min 4.3
#> 10 max 7.9
#> 11 Sepal.Width 8.00e-129 Student's one-sample t-test
#> 12 N 150
#> 13 Nmiss 0
#> 14 mean 3.06
#> 15 sd 0.436
#> 16 median 3
#> 17 Q1 2.8
#> 18 Q3 3.3
#> 19 min 2
#> 20 max 4.4
#> 21 Petal.Length 2.17e- 57 Student's one-sample t-test
#> 22 N 150
#> 23 Nmiss 0
#> 24 mean 3.76
#> 25 sd 1.77
#> 26 median 4.35
#> 27 Q1 1.6
#> 28 Q3 5.1
#> 29 min 1
#> 30 max 6.9
#> 31 Petal.Width 2.66e- 42 Student's one-sample t-test
#> 32 N 150
#> 33 Nmiss 0
#> 34 mean 1.20
#> 35 sd 0.762
#> 36 median 1.3
#> 37 Q1 0.3
#> 38 Q3 1.8
#> 39 min 0.1
#> 40 max 2.5
#> 41 Species 1 e+ 0 Chi-squared goodness-of-fit test
#> 42 setosa 50
#> 43 versicolor 50
#> 44 virginica 50
options(print_format = "tex")
descr(iris)
#> \needspace{2cm}
#>
#> \begin{longtable}[t]{>{\raggedright\arraybackslash}p{7em}cc}
#> \toprule
#> \multicolumn{1}{l}{Variable} & \multicolumn{1}{c}{Total} & \multicolumn{1}{c}{p} \\*
#> & (N=150) & \\*
#> \midrule
#> \endfirsthead
#> \multicolumn{3}{@{}l}{\textit{(continued)}}\\*
#> \toprule
#> \multicolumn{1}{l}{Variable} & \multicolumn{1}{c}{Total} & \multicolumn{1}{c}{p} \\*
#> & (N=150) & \\*
#> \midrule
#> \endhead
#>
#> \endfoot
#>
#> \endlastfoot
#> \addlinespace[0.5cm]
#> \multicolumn{3}{l}{\textbf{\begin{minipage}[t]{7em}\raggedright Sepal.Length\end{minipage}}}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}N\vspace{0.75ex}\end{minipage} & 150 & \vphantom{3} \textless0.001\textsuperscript{tt1}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}mean\vspace{0.75ex}\end{minipage} & 5.84 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}sd\vspace{0.75ex}\end{minipage} & 0.828 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}median\vspace{0.75ex}\end{minipage} & 5.8 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}Q1 - Q3\vspace{0.75ex}\end{minipage} & 5.1 -- 6.4 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}min - max\vspace{0.75ex}\end{minipage} & 4.3 -- 7.9 & \\ \noalign{\vskip 0pt plus 12pt}
#> \addlinespace[0.5cm]
#> \multicolumn{3}{l}{\textbf{\begin{minipage}[t]{7em}\raggedright Sepal.Width\end{minipage}}}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}N\vspace{0.75ex}\end{minipage} & 150 & \vphantom{2} \textless0.001\textsuperscript{tt1}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}mean\vspace{0.75ex}\end{minipage} & 3.06 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}sd\vspace{0.75ex}\end{minipage} & 0.436 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}median\vspace{0.75ex}\end{minipage} & 3 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}Q1 - Q3\vspace{0.75ex}\end{minipage} & 2.8 -- 3.3 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}min - max\vspace{0.75ex}\end{minipage} & 2 -- 4.4 & \\ \noalign{\vskip 0pt plus 12pt}
#> \addlinespace[0.5cm]
#> \multicolumn{3}{l}{\textbf{\begin{minipage}[t]{7em}\raggedright Petal.Length\end{minipage}}}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}N\vspace{0.75ex}\end{minipage} & 150 & \vphantom{1} \textless0.001\textsuperscript{tt1}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}mean\vspace{0.75ex}\end{minipage} & 3.76 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}sd\vspace{0.75ex}\end{minipage} & 1.77 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}median\vspace{0.75ex}\end{minipage} & 4.35 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}Q1 - Q3\vspace{0.75ex}\end{minipage} & 1.6 -- 5.1 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}min - max\vspace{0.75ex}\end{minipage} & 1 -- 6.9 & \\ \noalign{\vskip 0pt plus 12pt}
#> \addlinespace[0.5cm]
#> \multicolumn{3}{l}{\textbf{\begin{minipage}[t]{7em}\raggedright Petal.Width\end{minipage}}}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}N\vspace{0.75ex}\end{minipage} & 150 & \textless0.001\textsuperscript{tt1}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}mean\vspace{0.75ex}\end{minipage} & 1.2 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}sd\vspace{0.75ex}\end{minipage} & 0.762 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}median\vspace{0.75ex}\end{minipage} & 1.3 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}Q1 - Q3\vspace{0.75ex}\end{minipage} & 0.3 -- 1.8 & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}min - max\vspace{0.75ex}\end{minipage} & 0.1 -- 2.5 & \\ \noalign{\vskip 0pt plus 12pt} \pagebreak[3]
#> \addlinespace[0.5cm]
#> \multicolumn{3}{l}{\textbf{\begin{minipage}[t]{7em}\raggedright Species\end{minipage}}}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}setosa\vspace{0.75ex}\end{minipage} & 50 (33.3\%) & \textgreater0.999\textsuperscript{chi1}\\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}versicolor\vspace{0.75ex}\end{minipage} & 50 (33.3\%) & \\*
#> \hspace{1em}\begin{minipage}[t]{6em}\raggedright \setstretch{0.3}virginica\vspace{0.75ex}\end{minipage} & 50 (33.3\%) & \\*
#> \bottomrule
#> \multicolumn{3}{l}{\rule{0pt}{1em}\textsuperscript{tt1} Student's one-sample t-test}\\*
#> \multicolumn{3}{l}{\rule{0pt}{1em}\textsuperscript{chi1} Chi-squared goodness-of-fit test}\\*
#> \end{longtable}
options(print_format = "console")
descr(iris)
#> Variable Totl p Test
#> 1 Sp.L
#> 2 N 150 <0.001 tt1
#> 3 mean 5.84
#> 4 sd 0.828
#> 5 median 5.8
#> 6 Q1 - Q3 5.1 -- 6.4
#> 7 min - max 4.3 -- 7.9
#> 8 Sp.W
#> 9 N 150 <0.001 tt1
#> 10 mean 3.06
#> 11 sd 0.436
#> 12 median 3
#> 13 Q1 - Q3 2.8 -- 3.3
#> 14 min - max 2 -- 4.4
#> 15 Pt.L
#> 16 N 150 <0.001 tt1
#> 17 mean 3.76
#> 18 sd 1.77
#> 19 median 4.35
#> 20 Q1 - Q3 1.6 -- 5.1
#> 21 min - max 1 -- 6.9
#> 22 Pt.W
#> 23 N 150 <0.001 tt1
#> 24 mean 1.2
#> 25 sd 0.762
#> 26 median 1.3
#> 27 Q1 - Q3 0.3 -- 1.8
#> 28 min - max 0.1 -- 2.5
#> 29 Spcs
#> 30 sets 50 (33.3%) >0.999 chi1
#> 31 vrsc 50 (33.3%)
#> 32 vrgn 50 (33.3%)
DescrPrint <- print(descr(iris))
#> Variable Totl p Test
#> 1 Sp.L
#> 2 N 150 <0.001 tt1
#> 3 mean 5.84
#> 4 sd 0.828
#> 5 median 5.8
#> 6 Q1 - Q3 5.1 -- 6.4
#> 7 min - max 4.3 -- 7.9
#> 8 Sp.W
#> 9 N 150 <0.001 tt1
#> 10 mean 3.06
#> 11 sd 0.436
#> 12 median 3
#> 13 Q1 - Q3 2.8 -- 3.3
#> 14 min - max 2 -- 4.4
#> 15 Pt.L
#> 16 N 150 <0.001 tt1
#> 17 mean 3.76
#> 18 sd 1.77
#> 19 median 4.35
#> 20 Q1 - Q3 1.6 -- 5.1
#> 21 min - max 1 -- 6.9
#> 22 Pt.W
#> 23 N 150 <0.001 tt1
#> 24 mean 1.2
#> 25 sd 0.762
#> 26 median 1.3
#> 27 Q1 - Q3 0.3 -- 1.8
#> 28 min - max 0.1 -- 2.5
#> 29 Spcs
#> 30 sets 50 (33.3%) >0.999 chi1
#> 31 vrsc 50 (33.3%)
#> 32 vrgn 50 (33.3%)
DescrPrint$variables$results$Sepal.Length$Total$mean
#> NULL
print(DescrPrint)
#> $variables
#> $variables$Sepal.Length
#> $results
#> $results$Total
#> $results$Total$summary_stats
#> $results$Total$summary_stats$N
#> [1] "150"
#>
#> $results$Total$summary_stats$mean
#> [1] "5.84"
#>
#> $results$Total$summary_stats$sd
#> [1] "0.828"
#>
#> $results$Total$summary_stats$median
#> [1] "5.8"
#>
#> $results$Total$summary_stats$`Q1 - Q3`
#> [1] "5.1 -- 6.4"
#>
#> $results$Total$summary_stats$`min - max`
#> [1] "4.3 -- 7.9"
#>
#>
#> $results$Total$categories
#> list()
#>
#>
#>
#> $test_list
#> $test_list$p
#> [1] 3.331256e-129
#>
#> $test_list$test_name
#> [1] "Student's one-sample t-test"
#>
#>
#> $variable_name
#> [1] "Sepal.Length"
#>
#> $variable_options
#> $variable_options$label
#> [1] "Sepal.Length"
#>
#>
#> $variable_lengths
#> $variable_lengths$Total
#> $variable_lengths$Total$N
#> [1] 150
#>
#> $variable_lengths$Total$Nmiss
#> [1] 0
#>
#>
#>
#> $label
#> [1] "Sepal.Length"
#>
#> attr(,"class")
#> [1] "summary_stats" "list"
#>
#> $variables$Sepal.Width
#> $results
#> $results$Total
#> $results$Total$summary_stats
#> $results$Total$summary_stats$N
#> [1] "150"
#>
#> $results$Total$summary_stats$mean
#> [1] "3.06"
#>
#> $results$Total$summary_stats$sd
#> [1] "0.436"
#>
#> $results$Total$summary_stats$median
#> [1] "3"
#>
#> $results$Total$summary_stats$`Q1 - Q3`
#> [1] "2.8 -- 3.3"
#>
#> $results$Total$summary_stats$`min - max`
#> [1] "2 -- 4.4"
#>
#>
#> $results$Total$categories
#> list()
#>
#>
#>
#> $test_list
#> $test_list$p
#> [1] 8.004458e-129
#>
#> $test_list$test_name
#> [1] "Student's one-sample t-test"
#>
#>
#> $variable_name
#> [1] "Sepal.Width"
#>
#> $variable_options
#> $variable_options$label
#> [1] "Sepal.Width"
#>
#>
#> $variable_lengths
#> $variable_lengths$Total
#> $variable_lengths$Total$N
#> [1] 150
#>
#> $variable_lengths$Total$Nmiss
#> [1] 0
#>
#>
#>
#> $label
#> [1] "Sepal.Width"
#>
#> attr(,"class")
#> [1] "summary_stats" "list"
#>
#> $variables$Petal.Length
#> $results
#> $results$Total
#> $results$Total$summary_stats
#> $results$Total$summary_stats$N
#> [1] "150"
#>
#> $results$Total$summary_stats$mean
#> [1] "3.76"
#>
#> $results$Total$summary_stats$sd
#> [1] "1.77"
#>
#> $results$Total$summary_stats$median
#> [1] "4.35"
#>
#> $results$Total$summary_stats$`Q1 - Q3`
#> [1] "1.6 -- 5.1"
#>
#> $results$Total$summary_stats$`min - max`
#> [1] "1 -- 6.9"
#>
#>
#> $results$Total$categories
#> list()
#>
#>
#>
#> $test_list
#> $test_list$p
#> [1] 2.166017e-57
#>
#> $test_list$test_name
#> [1] "Student's one-sample t-test"
#>
#>
#> $variable_name
#> [1] "Petal.Length"
#>
#> $variable_options
#> $variable_options$label
#> [1] "Petal.Length"
#>
#>
#> $variable_lengths
#> $variable_lengths$Total
#> $variable_lengths$Total$N
#> [1] 150
#>
#> $variable_lengths$Total$Nmiss
#> [1] 0
#>
#>
#>
#> $label
#> [1] "Petal.Length"
#>
#> attr(,"class")
#> [1] "summary_stats" "list"
#>
#> $variables$Petal.Width
#> $results
#> $results$Total
#> $results$Total$summary_stats
#> $results$Total$summary_stats$N
#> [1] "150"
#>
#> $results$Total$summary_stats$mean
#> [1] "1.2"
#>
#> $results$Total$summary_stats$sd
#> [1] "0.762"
#>
#> $results$Total$summary_stats$median
#> [1] "1.3"
#>
#> $results$Total$summary_stats$`Q1 - Q3`
#> [1] "0.3 -- 1.8"
#>
#> $results$Total$summary_stats$`min - max`
#> [1] "0.1 -- 2.5"
#>
#>
#> $results$Total$categories
#> list()
#>
#>
#>
#> $test_list
#> $test_list$p
#> [1] 2.659021e-42
#>
#> $test_list$test_name
#> [1] "Student's one-sample t-test"
#>
#>
#> $variable_name
#> [1] "Petal.Width"
#>
#> $variable_options
#> $variable_options$label
#> [1] "Petal.Width"
#>
#>
#> $variable_lengths
#> $variable_lengths$Total
#> $variable_lengths$Total$N
#> [1] 150
#>
#> $variable_lengths$Total$Nmiss
#> [1] 0
#>
#>
#>
#> $label
#> [1] "Petal.Width"
#>
#> attr(,"class")
#> [1] "summary_stats" "list"
#>
#> $variables$Species
#> $results
#> $results$Total
#> $results$Total$summary_stats
#> list()
#>
#> $results$Total$categories
#> $results$Total$categories$setosa
#> [1] "50 (33.3%)"
#>
#> $results$Total$categories$versicolor
#> [1] "50 (33.3%)"
#>
#> $results$Total$categories$virginica
#> [1] "50 (33.3%)"
#>
#>
#>
#>
#> $test_list
#> $test_list$p
#> [1] 1
#>
#> $test_list$test_name
#> [1] "Chi-squared goodness-of-fit test"
#>
#>
#> $variable_name
#> [1] "Species"
#>
#> $variable_levels
#> [1] "setosa" "versicolor" "virginica"
#>
#> $variable_options
#> $variable_options$label
#> [1] "Species"
#>
#>
#> $variable_lengths
#> $variable_lengths$Total
#> $variable_lengths$Total$N
#> [1] 150
#>
#> $variable_lengths$Total$Nmiss
#> [1] 0
#>
#>
#>
#> $label
#> [1] "Species"
#>
#> attr(,"class")
#> [1] "summary_stats" "list"
#>
#>
#> $lengths
#> $lengths$Sepal.Length
#> [1] 7
#>
#> $lengths$Sepal.Width
#> [1] 7
#>
#> $lengths$Petal.Length
#> [1] 7
#>
#> $lengths$Petal.Width
#> [1] 7
#>
#> $lengths$Species
#> [1] 4
#>
#>
#> $group
#> $group$labels
#> list()
#>
#> $group$lengths
#> Total
#> 150
#>
#>
#> $group_names
#> [1] "Total"
#>
#> $format
#> $format$p
#> function (x)
#> {
#> pvalue(x, accuracy = accuracy, decimal.mark = decimal.mark,
#> prefix = prefix, add_p = add_p)
#> }
#> <bytecode: 0x563aa6615d60>
#> <environment: 0x563aac0b6000>
#>
#> $format$summary_stats
#> $format$summary_stats$N
#> function (x)
#> {
#> format(x, digits = 3, scientific = 4)
#> }
#> <environment: 0x563aaa8f3838>
#>
#> $format$summary_stats$mean
#> function (x)
#> {
#> format(x, digits = 3, scientific = 4)
#> }
#> <environment: 0x563aaa8f3838>
#>
#> $format$summary_stats$sd
#> function (x)
#> {
#> format(x, digits = 3, scientific = 4)
#> }
#> <environment: 0x563aaa8f3838>
#>
#> $format$summary_stats$median
#> function (x)
#> {
#> format(x, digits = 3, scientific = 4)
#> }
#> <environment: 0x563aaa8f3838>
#>
#> $format$summary_stats$Q1
#> function (x)
#> {
#> format(x, digits = 3, scientific = 4)
#> }
#> <environment: 0x563aaa8f3838>
#>
#> $format$summary_stats$Q3
#> function (x)
#> {
#> format(x, digits = 3, scientific = 4)
#> }
#> <environment: 0x563aaa8f3838>
#>
#> $format$summary_stats$min
#> function (x)
#> {
#> format(x, digits = 3, scientific = 4)
#> }
#> <environment: 0x563aaa8f3838>
#>
#> $format$summary_stats$max
#> function (x)
#> {
#> format(x, digits = 3, scientific = 4)
#> }
#> <environment: 0x563aaa8f3838>
#>
#> $format$summary_stats$CI
#> function (x)
#> {
#> format(x, digits = 3, scientific = 4)
#> }
#> <environment: 0x563aaa8f3838>
#>
#>
#> $format$options
#> $format$options$print_Total
#> [1] TRUE
#>
#> $format$options$print_p
#> [1] TRUE
#>
#> $format$options$print_CI
#> [1] FALSE
#>
#> $format$options$combine_mean_sd
#> [1] FALSE
#>
#> $format$options$combine_median_Q1_Q3
#> [1] FALSE
#>
#> $format$options$omit_factor_level
#> [1] "none"
#>
#> $format$options$omit_Nmiss_if_0
#> [1] TRUE
#>
#> $format$options$omit_missings_in_group
#> [1] TRUE
#>
#> $format$options$percent_accuracy
#> [1] 0.1
#>
#> $format$options$percent_suffix
#> [1] "%"
#>
#> $format$options$row_percent
#> [1] FALSE
#>
#> $format$options$Nmiss_row_percent
#> [1] FALSE
#>
#> $format$options$absolute_relative_frequency_mode
#> [1] "both" "only_absolute" "only_relative"
#>
#> $format$options$omit_missings_in_categorical_var
#> [1] FALSE
#>
#> $format$options$categorical_missing_percent_mode
#> [1] "no_missing_percent" "missing_as_regular_category"
#> [3] "missing_as_separate_category"
#>
#> $format$options$caption
#> NULL
#>
#> $format$options$replace_empty_string_with_NA
#> [1] TRUE
#>
#> $format$options$categories_first_summary_stats_second
#> [1] FALSE
#>
#> $format$options$max_first_col_width
#> [1] 7.5
#>
#>
#> $format$reshape_rows
#> $format$reshape_rows$`Q1 - Q3`
#> $format$reshape_rows$`Q1 - Q3`$args
#> [1] "Q1" "Q3"
#>
#> $format$reshape_rows$`Q1 - Q3`$fun
#> function (Q1, Q3)
#> {
#> paste0(Q1, " -- ", Q3)
#> }
#> <environment: 0x563aaa8f3838>
#>
#>
#> $format$reshape_rows$`min - max`
#> $format$reshape_rows$`min - max`$args
#> [1] "min" "max"
#>
#> $format$reshape_rows$`min - max`$fun
#> function (min, max)
#> {
#> paste0(min, " -- ", max)
#> }
#> <environment: 0x563aaa8f3838>
#>
#>
#>
#> $format$test_abbreviations
#> $format$test_abbreviations$`Cochran's Q test`
#> [1] "CocQ"
#>
#> $format$test_abbreviations$`McNemar's test`
#> [1] "McN"
#>
#> $format$test_abbreviations$`Chi-squared goodness-of-fit test`
#> [1] "chi1"
#>
#> $format$test_abbreviations$`Pearson's chi-squared test`
#> [1] "chi2"
#>
#> $format$test_abbreviations$`Exact McNemar's test`
#> [1] "eMcN"
#>
#> $format$test_abbreviations$`Boschloo's test`
#> [1] "Bolo"
#>
#> $format$test_abbreviations$`Exact binomial test`
#> [1] "Bin"
#>
#> $format$test_abbreviations$`Fisher's exact test`
#> [1] "Fish"
#>
#> $format$test_abbreviations$`Friedman test`
#> [1] "Frie"
#>
#> $format$test_abbreviations$`Wilcoxon two-sample signed-rank test`
#> [1] "Wil2"
#>
#> $format$test_abbreviations$`Wilcoxon's one-sample signed-rank test`
#> [1] "Wil1"
#>
#> $format$test_abbreviations$`Mann-Whitney's U test`
#> [1] "MWU"
#>
#> $format$test_abbreviations$`Kruskal-Wallis's one-way ANOVA`
#> [1] "KW"
#>
#> $format$test_abbreviations$`Student's paired t-test`
#> [1] "tpar"
#>
#> $format$test_abbreviations$`Mixed model ANOVA`
#> [1] "MiAn"
#>
#> $format$test_abbreviations$`Student's one-sample t-test`
#> [1] "tt1"
#>
#> $format$test_abbreviations$`Student's two-sample t-test`
#> [1] "stt2"
#>
#> $format$test_abbreviations$`Welch's two-sample t-test`
#> [1] "tt2"
#>
#> $format$test_abbreviations$`F-test (ANOVA)`
#> [1] "F"
#>
#> $format$test_abbreviations$`Cochran-Armitage's test`
#> [1] "CocA"
#>
#> $format$test_abbreviations$`Jonckheere-Terpstra's test`
#> [1] "JT"
#>
#> $format$test_abbreviations$`CI for difference in proportions derived from a normal ("Wald") approximation`
#> [1] "PWa"
#>
#> $format$test_abbreviations$`CI for difference in proportions derived from an unconditional exact test`
#> [1] "PUnc"
#>
#> $format$test_abbreviations$`CI for difference in proportions derived from an exact McNemar's test`
#> [1] "PMcN"
#>
#> $format$test_abbreviations$`CI for difference in means derived from the t-distribution`
#> [1] "t"
#>
#> $format$test_abbreviations$`CI for the Hodges-Lehmann estimator`
#> [1] "HL"
#>
#> $format$test_abbreviations$`CI for odds ratio derived from Fisher's exact test`
#> [1] "Odds"
#>
#> $format$test_abbreviations$`No test`
#> [1] "NA"
#>
#>
#>
#> $group_labels
#> [1] "Total"
#>
#> $labels
#> $labels$Sepal.Length
#> [1] "Sepal.Length"
#>
#> $labels$Sepal.Width
#> [1] "Sepal.Width"
#>
#> $labels$Petal.Length
#> [1] "Petal.Length"
#>
#> $labels$Petal.Width
#> [1] "Petal.Width"
#>
#> $labels$Species
#> [1] "Species"
#>
#>
#> $tibble
#> # A tibble: 32 × 4
#> Variable Total p Test
#> <chr> <chr> <chr> <chr>
#> 1 Sepal.Length "" "" ""
#> 2 N "150" "<0.001" "Student's one-sample t-test"
#> 3 mean "5.84" "" ""
#> 4 sd "0.828" "" ""
#> 5 median "5.8" "" ""
#> 6 Q1 - Q3 "5.1 -- 6.4" "" ""
#> 7 min - max "4.3 -- 7.9" "" ""
#> 8 Sepal.Width "" "" ""
#> 9 N "150" "<0.001" "Student's one-sample t-test"
#> 10 mean "3.06" "" ""
#> # ℹ 22 more rows
#>
#> attr(,"class")
#> [1] "DescrPrint" "DescrPrintCharacter" "list"