- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 check the difference between plot generation time in base R?
One of the mostly used time measurement function in R is microbenchmark function of microbenchmark package. We can pass the function to create the plot inside microbenchmark function and this will result in the processing time for each of the plots then a comparison can be done for the difference.
Example1
Loading microbenchmark package:
> library(microbenchmark)
Finding the plot generation time:
> x1<-rpois(10,5) > x2<-rpois(100,5) > x3<-rpois(1000,5) > X<-microbenchmark(plot(x1),plot(x2),plot(x3)) > X
Unit: milliseconds
expr min lq mean median uq max neval plot(x1) 12.7488 14.88815 15.65040 15.2515 15.90765 23.9348 100 plot(x2) 20.9810 21.67780 23.92976 22.2116 23.29665 137.2474 100 plot(x3) 93.6965 95.03440 96.67086 95.6717 97.12290 125.3670 100
Plots:
Example
> plot(x1)
Output:
Example
> plot(x2)
Output:
Example
> plot(x3)
Output:
- Related Articles
- How to remove the plot margin in base R between the axes and the points inside the plot?
- How to rotate text in base R plot?
- How to display fraction in base R plot?
- How to remove Index in base R plot?
- How to create a vertical line in a time series plot in base R?\n
- How to change the axis color in base R plot?
- How to create empty bar plot in base R?
- How to display infinity symbol in base R plot?
- How to display x-bar in base R plot?
- How to add a picture to plot in base R?
- How to change the resolution of a plot in base R?
- How to change the axis ticks color in base R plot?
- How to change the Y-axis title in base R plot?
- How to create a plot in base R without margins?
- How to create a perpendicular arrow in base R plot?

Advertisements