I have a time-series of 10 objects measured along 12 hours to monitor a specific variable. The time-series is stored in a data frame like this:
> myTS
hr1 hr2 hr3 hr4 hr5 hr6 hr7 hr8 hr9 hr10 hr11 hr12
1 43 108 71 64 112 46 115 375 187 163 55 190
2 153 123 110 141 107 139 105 137 126 277 316 48
3 159 65 65 69 70 73 65 66 65 66 139 90
4 310 300 256 251 25 208 219 180 63 134 454 351
5 183 225 20 313 245 30 267 345 279 330 36 88
I'm trying to plot these on a single plot window with the time on the x axis and values on the y axis for each of the 5 objects, and differentiate the 5 lines using different colors. I have tried the plot.ts()
function but it gives an error saying:
Error in plotts(x = x, y = y, plot.type = plot.type, xy.labels = xy.labels, :
cannot plot more than 10 series as "multiple"
Then I tried the lines()
function but still doesn't work. Any help please??!!