Creating tables used at the end of reports, for reproducibility. Most of the information is based off of sessioninfo::session_info()
get_session_info()
list of length two, containing dataframe of Software Session Information and dataframe of Software Package Version Information
Both tables usually printing with kable()
at the end of a report
my_session_info <- get_session_info() library(dplyr)#> #>#>#> #>#>#> #>#>#> #>#>#> #># Simple HTML Display kableExtra::kable(my_session_info$platform_table, 'html', caption = "Reproducibility Software Session Information") %>% kableExtra::kable_styling()#> <table class="table" style="margin-left: auto; margin-right: auto;"> #> <caption>Reproducibility Software Session Information</caption> #> <thead> #> <tr> #> <th style="text-align:left;"> name </th> #> <th style="text-align:left;"> value </th> #> </tr> #> </thead> #> <tbody> #> <tr> #> <td style="text-align:left;"> version </td> #> <td style="text-align:left;"> R version 3.5.2 (2018-12-20) </td> #> </tr> #> <tr> #> <td style="text-align:left;"> os </td> #> <td style="text-align:left;"> macOS High Sierra 10.13.6 </td> #> </tr> #> <tr> #> <td style="text-align:left;"> system </td> #> <td style="text-align:left;"> x86_64, darwin15.6.0 </td> #> </tr> #> <tr> #> <td style="text-align:left;"> ui </td> #> <td style="text-align:left;"> X11 </td> #> </tr> #> <tr> #> <td style="text-align:left;"> language </td> #> <td style="text-align:left;"> (EN) </td> #> </tr> #> <tr> #> <td style="text-align:left;"> collate </td> #> <td style="text-align:left;"> en_US.UTF-8 </td> #> </tr> #> <tr> #> <td style="text-align:left;"> ctype </td> #> <td style="text-align:left;"> en_US.UTF-8 </td> #> </tr> #> <tr> #> <td style="text-align:left;"> tz </td> #> <td style="text-align:left;"> America/New_York </td> #> </tr> #> <tr> #> <td style="text-align:left;"> date </td> #> <td style="text-align:left;"> 2019-03-15 </td> #> </tr> #> <tr> #> <td style="text-align:left;"> repo </td> #> <td style="text-align:left;"> git@github.com:gadenbuie/MoffittFunctions.git </td> #> </tr> #> <tr> #> <td style="text-align:left;"> file name </td> #> <td style="text-align:left;"> No Input File Detected </td> #> </tr> #> <tr> #> <td style="text-align:left;"> location </td> #> <td style="text-align:left;"> No Input File Location Detected </td> #> </tr> #> <tr> #> <td style="text-align:left;"> user </td> #> <td style="text-align:left;"> Garrick Aden-Buie </td> #> </tr> #> </tbody> #> </table>kableExtra::kable(my_session_info$packages_table, 'html', caption = "Reproducibility Software Package Version Information") %>% kableExtra::kable_styling()#> <table class="table" style="margin-left: auto; margin-right: auto;"> #> <caption>Reproducibility Software Package Version Information</caption> #> <thead> #> <tr> #> <th style="text-align:left;"> package </th> #> <th style="text-align:left;"> version </th> #> <th style="text-align:left;"> date </th> #> <th style="text-align:left;"> source </th> #> </tr> #> </thead> #> <tbody> #> <tr> #> <td style="text-align:left;"> MoffittFunctions </td> #> <td style="text-align:left;"> 1.0.0 </td> #> <td style="text-align:left;"> 2019-03-15 </td> #> <td style="text-align:left;"> local </td> #> </tr> #> <tr> #> <td style="text-align:left;"> testthat </td> #> <td style="text-align:left;"> 2.0.1 </td> #> <td style="text-align:left;"> 2018-10-13 </td> #> <td style="text-align:left;"> CRAN (R 3.5.0) </td> #> </tr> #> </tbody> #> </table># Latex Display kableExtra::kable(my_session_info$platform_table, 'latex', booktabs = TRUE, linesep = '', caption = "Reproducibility Software Session Information") %>% kableExtra::kable_styling(font_size = 7)#> \begin{table}[t] #> #> \caption{\label{tab:}Reproducibility Software Session Information} #> \centering #> \fontsize{7}{9}\selectfont #> \begin{tabular}{ll} #> \toprule #> name & value\\ #> \midrule #> version & R version 3.5.2 (2018-12-20)\\ #> os & macOS High Sierra 10.13.6\\ #> system & x86\_64, darwin15.6.0\\ #> ui & X11\\ #> language & (EN)\\ #> collate & en\_US.UTF-8\\ #> ctype & en\_US.UTF-8\\ #> tz & America/New\_York\\ #> date & 2019-03-15\\ #> repo & git@github.com:gadenbuie/MoffittFunctions.git\\ #> file name & No Input File Detected\\ #> location & No Input File Location Detected\\ #> user & Garrick Aden-Buie\\ #> \bottomrule #> \end{tabular} #> \end{table}kableExtra::kable(my_session_info$packages_table, 'latex', booktabs = TRUE, linesep = '', caption = "Reproducibility Software Package Version Information") %>% kableExtra::kable_styling(font_size = 7)#> \begin{table}[t] #> #> \caption{\label{tab:}Reproducibility Software Package Version Information} #> \centering #> \fontsize{7}{9}\selectfont #> \begin{tabular}{llll} #> \toprule #> package & version & date & source\\ #> \midrule #> MoffittFunctions & 1.0.0 & 2019-03-15 & local\\ #> testthat & 2.0.1 & 2018-10-13 & CRAN (R 3.5.0)\\ #> \bottomrule #> \end{tabular} #> \end{table}