Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in R Programming by (50.2k points)

Basically I am having 54 models and I wanted to have multiple Time series plots on the single plot in R. I know we can do something like :

ts.plot(model_1, model_2, model_3, col = 1:3)

Is there any other way to perform this? I have tried to plot them manually, refer to the code below:

for (i in 1:54){

ts.plot(model[i], model[i+1])

}

1 Answer

0 votes
by (108k points)

In R programming, you can simply have the do.call() function and with the help of mget() you will be getting all the plots in a list, refer to the code below:

do.call(ts.plot, mget(paste0("model", 1:54)))

Related questions

0 votes
1 answer
asked Apr 9, 2020 in Data Science by Sudhir_1997 (55.6k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...