can you help me how to have data labels in my R chart
date = c(1.45,0.89,0.74,3.28)
plot(date,type = "l")
I need the percentages to be displayed
can you help me how to have data labels in my R chart
date = c(1.45,0.89,0.74,3.28)
plot(date,type = "l")
I need the percentages to be displayed
Use text
.
First, though, I'll expand the axis limits to make room.
plot(date, type = "l", xlim = c(0.5, 4.5), ylim = range(date) + c(-0.5, 0.5))
text(seq_along(date), date+0.2, paste(date, "%"))
Arbitrary components:
date
, may need to play with this if your data changesdate + 0.2
to shift the numbers slightly above the points;