cline | R Documentation |
This function adds colored line segments to an existing plot. The line is plotted at points specified by inputs x and y, and colored according to factor input z (with one color for each level of z).
cline(x, y, z, color_vector)
x |
x positions of points to be plotted |
y |
y positions of points to be plotted |
z |
a factor, the same length as x and y. Line segments in the resulting plot will be colored according to the levels of z. |
color_vector |
a list of colors to use (length should match the number of levels in z). |
adds colored lines to a graph
cline(x=ChickWeight$Time, y=ChickWeight$weight,
z=as.factor(ChickWeight$Diet),
color_vector=c('black', 'grey20',
'grey50', 'grey70'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.