r - Plot Vector of Points in Time Series Data Matrix -
i have 100*8 data matrix each row vector of values @ 8 different time points. interested know how plot following matrix in r graph closely similar 1 below:
here example of data matrix.
1 2 3 4 5 6 7 8 line1 0.22 0.075 0.35 0.89 0 0.35 0.42 2.34 line2 0 0.47 0.89 2.51 0 0.36 1.14 2.09 line3 1.22 0.075 0.35 0.89 0 0.35 0.42 1.34 line4 2.22 0.75 0.45 0.99 0 0.54 0.24 2.34 line5 3.22 0.275 0.55 0.819 0 0.25 0.34 2.34
any or advice highly appreciated. thanks.
try matplot()
. default treats columns series need transpose (t()
) data frame before use. here example using subset of data supplied
timeser <- read.table(text = " 1 2 3 4 5 6 7 8 line1 0.22 0.075 0.35 0.89 0 0.35 0.42 2.34 line2 0 0.47 0.89 2.51 0 0.36 1.14 2.09 line3 1.22 0.075 0.35 0.89 0 0.35 0.42 1.34 line4 2.22 0.75 0.45 0.99 0 0.54 0.24 2.34 line5 3.22 0.275 0.55 0.819 0 0.25 0.34 2.34", header = true) matplot(t(timeser), type = "l")
producing
Comments
Post a Comment