Microplots (Sparklines) in 'LaTeX', 'Word', 'HTML', 'Excel'

The microplot function writes a set of R graphics files to be used as microplots (sparklines) in tables in either 'LaTeX', 'HTML', 'Word', or 'Excel' files. For 'LaTeX', we provide methods for the Hmisc::latex() generic function to construct 'latex' tabular environments which include the graphs. These can be used directly with the operating system 'pdflatex' or 'latex' command, or by using one of 'Sweave', 'knitr', 'rmarkdown', or 'Emacs org-mode' as an intermediary. For 'MS Word', the msWord() function uses the 'flextable' package to construct 'Word' tables which include the graphs. There are several distinct approaches for constructing HTML files. The simplest is to use the msWord() function with argument filetype="html". Alternatively, use either 'Emacs org-mode' or the htmlTable::htmlTable() function to construct an 'HTML' file containing tables which include the graphs. See the documentation for our as.htmlimg() function. For 'Excel' use on 'Windows', the file examples/irisExcel.xls includes 'VBA' code which brings the individual panels into individual cells in the spreadsheet. Examples in the examples and demo subdirectories are shown with 'lattice' graphics, 'ggplot2' graphics, and 'base' graphics. Examples for 'LaTeX' include 'Sweave' (both 'LaTeX'-style and 'Noweb'-style), 'knitr', 'emacs org-mode', and 'rmarkdown' input files and their 'pdf' output files. Examples for 'HTML' include 'org-mode' and 'Rmd' input files and their webarchive 'HTML' output files. In addition, the as.orgtable() function can display a data.frame in an 'org-mode' document. The examples for 'MS Word' (with either filetype="docx" or filetype="html") work with all operating systems. The package does not require the installation of 'LaTeX' or 'MS Word' to be able to write '.tex' or '.docx' files.


Version: 1.0-42

  • 2018 Aug 18

  • msWord.microplotMatrix: additional checks needed before calling flextable::merge_at

Version: 1.0-41

  • 2018 Jul 18

  • restore msWord methods. Change dependence of msWord.microplotMatrix from ReporteRs to flextable and officer for production of MS Word documents.

  • add new arguments to demo/tablesPlusGraphicColumn.r

  • adjust argument values in demo/AEdotplot.r, demo/LegendrePolynomials.r

  • CRAN: 2018-07-18

Version: 1.0-40

  • 2018 Jul 14

  • The msWord methods are temporarily disabled, and replaced by a warning, in microplot_1.0-40. All other features of microplot continue to work.

    msWord depends on the ReporteRs package which was archived on July 16, 2018. The functions in the replacement package flextable have different calling sequences and I haven't worked out the details yet. In the meantime, please use the older release microplot_1.0-39 along with the archived ReporteRs.

  • repair typos in demo/iris.r

  • CRAN: 2018-07-15

Version: 1.0-39

  • 2018 Jun 04

  • coordinate with ggplot2_2.3.0: facet_grid() now produces an empty named list for unspecified column (previously NULL).

  • ggplot2::geom_point() requires shape= to be inside aes().

  • on CRAN: 2018-06-05

Version: 1.0-38

  • 2018 Mar 12

  • smooth out DESCRIPTION and ?microplot-package. Incorporate tutorial into microplot-package.Rd and demo/HowToUseMicroplot.r

demo AEdotplot Examples HowToUseMicroplot LegendrePolynomials NTplot boxplot-ggplot bwplot-lattice iris latex-ggplot latex msWord regrcoef tablesPlusGraphicColumn timeseries

  • The latex.* functions in the microplot package place their graphics files in a directory inside the working directory with the same basename as the generated .tex or .docx file. A new function dir.verify makes sure the directory exists.

  • The microplot.* functions place their graphics files in filenames specified by the figPrefix argument. These functions rely on the calling latex() or msWord() function to make it a subdirectory.

  • new function: latexSetOptions. Defaults to "pdflatex".

  • define dvi.latexConsole to put latex console output in a file.

  • new classes msWordFilename and htmlFilename, and print methods that call system(paste("open", x))

  • msWord and latex and msWord can now uses label.x.axis and label.y.axis distinct from xlab and ylab.

  • New function microplotAttrDisplay called by microplot() determines if the axis and key microplots are attributes or placed into the matrix of filenames.

  • tighten up [.microplotMatrix and [.includegraphicsMatrix, and attributes for both, and documentation.

  • change png default to res=600 and make res a new argument to microplot.

  • use cowplot to index into individual panels in ggplot and to get the ggplot legend. I now illustrate equivalent capabilities with lattice and ggplot.

  • redesigned microplot.AEdotplot, latex.AEdotplot, msWord.AEdotplot. These are now models for complex graphic structures.

  • AEdotplotMethods.R function microplot.AEdotplot now produces class microplotMatrix in both latex and msWord.

  • demo/AEdoplotr.r uses latex.includegraphicsMatrix and msWord.microplotMatrix.

  • both msWord.microplotMatrix and demo/LegendrePolynomials-MSWord.r have explicit tests for mingw32. UTF-8 text strings (for Greek letters) can't easily be used on Windows.

  • Not yet done: Write paper for R Journal, or JCGS

  • CRAN: 2018-03-13

Version: 1.0-25

  • 2018 Jan 08

  • 1.0-25 on CRAN 2018-01-10

  • New latex methods for trellis and ggplot. latex.trellis and latex.ggplot methods for one- and two-dimension objects. The latex generic accepts, and forwards, all arguments to microplot and as.includegraphics.

  • New generic function MSWord() with trellis and ggplot methods (based on ReporteRs package).

  • New generic function microplot() with complete set of methods for trellis and ggplot.

  • Improved as.includegraphics(), now a generic with methods and attributes.

  • import and re-export latex and dvi generics.

  • microplot() has new collapse argument to zero out unwanted layout.heights and layout.widths space in lattice and provide a theme_collapse for ggplot.

  • AEdotplot methods and demos for latex() and MSWord()

  • demo/LegendrePolynomials, example of matrix of panels with lots of control at the panel level

  • Replace previous demo/timeseries.r with a more interesting timeseries example containing a collection of rearrangements of a set of annual plots. The demo illustrates arranging a vector of panels into a matrix, and control of the placement of common axes in the LaTeX table containing the individual panels.

demo AEdotplot latex MSWord demos tablesPlusGraphicColumn

Version: 1.0-16

  • on CRAN: 2017-01-19

demo boxplot.ggplot.r bwplot.lattice.r

examples irisExcel.xls

Version: 1.0-14

  • on CRAN: 2016-06-21

as.includegraphics layoutCollapse themeCollapse

examples irisKnitr.Rnw irisMarkdown.Rmd irisNoweb.Rnw irisOrg.org irisOrgHtml.org irisRMarkdownHtml.Rmd irisSweave.Rtex irisSweaveTakeApart.Rtex

demo NTplot.r bwplot.r iris.r timeseries.r

vignette rmhPoster.pdf

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.0-42 by Richard M. Heiberger, 6 months ago

Browse source code at https://github.com/cran/microplot

Authors: Richard M. Heiberger , with contributions from Karen Byron and Nooreen Dabbish.

Documentation:   PDF Manual  

GPL (>= 2) license

Imports Hmisc, HH, lattice, grid, flextable, officer, ggplot2, htmltools, cowplot

Suggests reshape2, latticeExtra, xtable, markdown, rmarkdown, knitr, htmlTable

Suggested by HH.

See at CRAN