View source: R/FUNCTION_VariousSparkPlots.R
spark.line | R Documentation |
These functions generate various minimalist plots that can be combined into a multipanel dashboard. Check the worked examples in Package ReadMe for illustrations.
spark.line(
x,
avg = 4,
x.lim = NULL,
y.lim = NULL,
ref.line = NULL,
ref.line.v = NULL,
ref.band = NULL,
type = "l",
pch = 19,
cex = 0.2
)
spark.band(x, avg = 4, x.lim = NULL, y.lim = NULL, ref.line = NULL)
spark.text(x, pos = c(5, 5), adj = 0.5, cex = 1, font = 1, col = "black")
spark.sep(col = "lightblue", lty = 1, lwd = 2)
x |
a data frame with Year and Some Value (for spark.line) or a data frame with Year and lower,mid,upper (for spark.band) or a text string (for spark.text). |
avg |
number of years used for rolling avg (applies to spark.line) |
x.lim |
plot limits for x-axis (Year). Default is NULL, producing default R axis range. |
y.lim |
plot limits for y-axis (Value).Default is NULL, producing default R axis range. |
ref.line |
1 or more values for a horizontal reference line (applies to spark.line and spark.band) |
ref.line.v |
1 or more values for a vertical reference line (applies to spark.line and spark.band) |
ref.band |
vector with 2 values giving a horizontal band |
type |
plot type. default = "l" for lines. other options are ("p" for points, "o" for points and lines) |
pch |
plotting character (19 = solid circle) |
cex |
= point expansion. default = 0.2 (20 percent of default) |
spark.line(SR_Sample[SR_Sample$Stock == "Stock1","Spn"])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.