The Gmisc package is a collection of different useful functions for graphics, tables etc that I’ve created/adapted for my own research.
To install use:
1 2 3
reps = c("http://ftp.sunet.se/pub/lang/CRAN", "http://cran.gforge.se") install.packages("Gmisc", repos=reps, dependencies=TRUE)
In case you’re using a Mac you need to install from source:
1 2 3
reps = c("http://ftp.sunet.se/pub/lang/CRAN", "http://cran.gforge.se") install.packages("Gmisc", repos=reps, dependencies=TRUE, type="source")
New: I’ve added a GitHub-repository – you can find it here. In case you want to suggest some changes, please use the GitHub-version as it has all the roxygen documentation and all my comments. I generally try to comment as much as I can.
The main functions that I’ve created are:
- forestplot2 – an adaptation of the rmeta package forestplot with some additional tweaks
- plotHR – this is based upon r-forge Reinhard Seifert’s plotHR function. The function allows multiple models to be plotted on top of eachother, when used together with transparency (the alpha channel of the rgb) it is very convenient for comparing different subgroups, time-spans or adjusted/unadjusted regressions.
- htmlTable – it is often difficult to convert LaTeX into word without some loss to design, therefore I’ve created an alternativ to the Hmisc latex() function with basically the same parameters and output but that works in markdown. I recommend opening the html-document in LibreOffice, and from there exporting to Word. This since Word does a very poor job at reading html formatting.
- printCrudeAndAdjusted – a useful function for generating a table with a models crude and adjusted estimates.
- getDescriptionsStatsBy – for generating a table 1 this is a very useful function that makes this much easier.
- transitionPlot – for generating a transition plot
- bezierArrowSmpl/bezierArrowSmplGradient – nicer alternatives to the default bezier arrow.
I hope you find the package as useful as I do. Once the package reaches the proper maturity I will try to publish it on CRAN. Yes, the name is a ripoff from Frank Harrells useful Hmisc-package.