 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create a time series plot in R without time vector?
To create a time series plot in R without time vector, we can use ts.plot function.
For Example, if we have a vector called X then we can create the time series plot of X by using the command ts.plot(X), the Output of this command will have a time axis in place of X-axis. Check out the below Examples to understand how it works.
Example 1
Consider the following vector −
x<-rnorm(10) ts.plot(x)
Output
If you execute the above given snippet, it generates the following Output −

Example 2
To create a time series plot in R without time vector, add the following code to the above snippet −
y<-rpois(10,5) ts.plot(y)
Output
If you execute all the above given snippets as a single program, it generates the following Output −

Advertisements
 