ibecav / CGPfunctions

Powell Miscellaneous Functions for Teaching and Learning Statistics
Other
27 stars 11 forks source link

newggslopegraph: line color based on change over time/slope? #16

Closed nkarimi closed 4 years ago

nkarimi commented 5 years ago

Is there a way to color the lines (LineColor) based on the slope or change over time? For example, positive increase the line=green and for negative change the line=red? It would be the equivalent to your cancer dataset example where you used: LineColor = c("red", rep("gray",4), "red", rep("gray",3)). Thanks very much.

ibecav commented 4 years ago

Please see the last example in the vignette. LineColor is just a character string you can either manually or via a script make it as simple or complex as you like. I did add some additional example code to the vignette to demonstrate your use case.