Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S3 method for microbenchmark #107

Merged
merged 6 commits into from Jul 22, 2014

Conversation

RomanTsegelskyi
Copy link
Contributor

S3 method for microbenchmark class.
Also supports unit param and user defined expression names.

Basic examples

> pander(b)

--------------------------------------------------------
            expr               min   lq    median   uq  
----------------------------- ----- ----- -------- -----
    pander(data.frame(a =     3.543 4.264  4.822   6.138
"foo\nbar"), keep.line.breaks                            
           = TRUE)                                      

    pander(data.frame(a =     3.415 4.018  4.614   5.504
         "foo\nbar"))                                    
--------------------------------------------------------

Table: Unit: milliseconds (continued below)


-------------
 max   neval 
----- -------
11.61   100  

11.5    100  
-------------
> pander(b, split.tables = Inf)

----------------------------------------------------------------------
            expr               min   lq    median   uq    max   neval 
----------------------------- ----- ----- -------- ----- ----- -------
    pander(data.frame(a =     3.543 4.264  4.822   6.138 11.61   100  
"foo\nbar"), keep.line.breaks                                          
           = TRUE)                                                    

    pander(data.frame(a =     3.415 4.018  4.614   5.504 11.5    100  
         "foo\nbar"))                                                  
----------------------------------------------------------------------

Table: Unit: milliseconds

Supports user defined expression labels through expr.labels

> pander(b, split.tables = Inf, expr.labels = c("First", "Second"))

-----------------------------------------------
 expr   min   lq    median   uq    max   neval 
------ ----- ----- -------- ----- ----- -------
First  3.543 4.264  4.822   6.138 11.61   100  

Second 3.415 4.018  4.614   5.504 11.5    100  
-----------------------------------------------

Table: Unit: milliseconds

Supports different units through unit param.

> pander(b, split.tables = Inf, expr.labels = c("First", "Second"), unit = "s")
----------------------------------------------------------
 expr    min       lq     median     uq      max    neval 
------ -------- -------- -------- -------- ------- -------
First  0.003543 0.004264 0.004822 0.006138 0.01161   100  

Second 0.003415 0.004018 0.004614 0.005504 0.0115    100  
----------------------------------------------------------

Table: Unit: seconds

daroczig added a commit that referenced this pull request Jul 22, 2014
@daroczig daroczig merged commit b48fc68 into Rapporter:master Jul 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants