简体   繁体   中英

Sparklines in R for use in Latex table (using Knitr)

I would like to create a sparkline using R and include it in a Latex table (using knitr) .

I have found the SparkTable package but have been unable to work out how to specify (based on my own set of rules) which data points are classified as "outliers".

Effectively, I only want to colour the last data point (either Red, Blue, Grey, or no colour) (based on a custom rule). In addition, I would like to specify the limits for the y-axis and for the image to look similar to the following,

在此输入图像描述

Any help / suggestions will be much appreciated

Thanks, Marie

I should have read the manual in more detail - apologies. Page 20 of the version April 20, 2015

• if type=='allColors': a character vector of length 6 (including NA's) containing colors. The elements of the color vector are used as:

  • first element: color for minimal value
  • second element: color for maximal value
  • third element: color for last value
  • fourth element:color for filling
  • fifth element: color for the line
  • sixth element: color for interquartil range

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM