Description Usage Arguments Value See Also Examples
For marking the minumum/maximum, the crayon
package
is needed.
1 2 3 |
data |
The data to visualize. It can be a numeric
vector, or anything that can be cut into intervals
with |
width |
The width (number of characters) of the output. ‘data’ means that it will match the length of the data. ‘screen’ means that it will be scaled to match the width of the screen. ‘auto’ means ‘data’ if the length of the data is not longer than the screen width, and ‘screen’ otherwise. |
min |
If not NULL, then a crayon style to mark the minimum value. |
max |
If not NULL, then a crayon style to mark the maximum value. |
range |
Numeric vector with two elements, the range for the sparklines. Defaults to the range of the data. |
... |
Not used, it is an error if given. |
Character scalar containing the spark line.
Other spark: spark.matrix
,
spark
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Annual number of Lynx trappings
spark(lynx)
## Scaling to shorter
spark(lynx, width = 40)
## Changing the range
spark(1:10)
spark(1:10, range = c(1, 100))
## Scaling to longer
spark(1:10, width = 40)
## Luteinizing Hormone in Blood Samples,
## in blue, if the terminal supports it
cat(crayon::blue(spark(lh)), "\n")
|
...._==<U+2588>*_....._==_......____....._==_....._=<U+2588>=.....____......_=*_......._==....._=<U+2588><U+2588>=_..._=====......__==_...__==
._<U+2588>_.__.._..=_.==.__._=.._=._<U+2588>__==..=__=
..__==*<U+2588><U+2588><U+2588>
..........
........________========****<U+2588><U+2588><U+2588><U+2588><U+2588><U+2588><U+2588><U+2588><U+2588><U+2588><U+2588>
====_.===___=_<U+2588><U+2588>===___=<U+2588>=__**=====__.._<U+2588><U+2588><U+2588><U+2588>=_<U+2588><U+2588>*
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.