Description Awesome tables Convenient knitr-helpers Some fancy plots Other stuff
This is a collection of functions that I've found useful in my research. The package is inspired by Frank Harrell's Hmisc package. The main focus is on tables, plots, and knitr-integration.
For tables you'll find the convenient htmlTable
that I have used
for advanced table layout. A major focus has been to have
it compatible with LibreOffice (you can copy/past from there into word)
as I generally want to be able to send my documents to a
journal in .doc/.docx format. Note: it is now in
RStudio possible to copy->paste
directly from the viewer into a MS Word document with minimal
layout loss.
The getDescriptionStatsBy
is a straight forward function that
aims at helping you to generate descriptive table stratified by different
variables. In other words, the function returns everything you need for generating
a Table 1 ready for publication. This function is accompanied by the
describeMean
, describeMedian
, describeProp
,
and describeFactors
functions.
One of the main priorities of this package is to make the preparation of
publication-ready manuscripts through the
knitr-package. The figCapNo
can be used for automated figure counting. The pvalueFormatter
tries to simplify rounding of p-values, e.g. you may be ok with just
0.0005 as a p-value but when you come close to the "magic" 0.05 value
you may want to have two significant digits, i.e. 0.048 instead of just 0.05.
The outputInt
simply transforms a large integer digit
to proper formatting.
The forest plot function, forestplot2
, is a more general
version of the original rmeta-packages forestplot
implementation. The aim is at using forest plots for more than
just meta-analyses.
The transition plot function, transitionPlot
, is for
descriptive purposes. It tries to illustrate the size of change
between one state and the next, i.e. a transition. This is
basically a graph of based upon table(var1, var2)
.
The Singular value decomposition
is a common method for reducing the number of variables. Unfortunately
this compression can reduce the interpretability of the model. The getSvdMostInfluential
function tries to remedy that by identifying the most influential
elements from the V
-matrix.
The getTicks
tries to format ticks for plots in a nicer way.
The major use is for exponentials where ticks are generated using the
2^n since a doubling is a concept easy to grasp even for
non-statisticians.
The insertRowAndKeepAttr
simply adds a row while remembering
all the attributes previously set by using the copyAllNewAttributes
.
The mergeLists
tries to merge lists that do not have identical
elements.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.