The following R codes produce one graph for time series, while the next chunks of codes produce 8 graphs. Why?
births <- scan("http://robjhyndman.com/tsdldata/data/nybirths.dat") birthstimeseries <- ts(births, frequency=12, start=c(1946,1)) birthstimeseries plot.ts(birthstimeseries) The 2nd chunks of codes:
library(Matrix) i <- c(1, 3, 8, 4, 2, 7, 6, 9, 1, 4, 10, 5, 11, 2, 12) j <- c(2, 5, 3, 8, 6, 2, 4, 2, 4, 5, 2, 7, 3, 2, 1) x <- rpois(15, 5) M4 <- sparseMatrix(i, j, x = x) M4_regular_matrix <- as(M4, "matrix") timeseries <- ts(M4_regular_matrix) print(timeseries) plot.ts(timeseries) Also, in the first graph, how is the plot drawn? Is it, for the year 1946, it connects all the points from Jan to Dec, and the last point of 1946 is connected to the first point of 1947, and so on?


