How to use sparktable in knitr with rmarkdown for PDF

683 Views Asked by At

Just learned about sparktable and went over few documents about it. I was wondering if it can be used with knitr and rmarkdown to produce a PDF document that embed sparktable?

Also, I noticed plotSparkTable() used in many examples, but it does not exist in the latest version 1.0 and it does exist in 0.9. Is there a replacement plotSparkTable()?

1

There are 1 best solutions below

1
On

See "sparkTable: Generating Graphical Tables for Websites and Documents with R" for examples of how to use sparkTable with knitr. Here's an example from the article:

```{r , echo = TRUE }
require ( sparkTable )
sl <- newSparkLine ( values = rnorm (25) , lineWidth = .18 , pointWidth = .4 ,
width = .4 , height = .08)
export ( sl , outputType = " png " , filename = " sparkLine ")
```
This is a sparkline included in the ![ firstSparkLine ]( sparkLine . png )
text ...

export() is the replacement for plotSparkTable()