Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy the 'Measured negative execution time!' error appears? (And how to deal with it?)
    primarykey
    data
    text
    <p>I am getting to know some of the <code>microbenchmark</code> <code>R</code> package's featrues. I implemented a sample code from <a href="http://adv-r.had.co.nz/Performance.html" rel="nofollow">this</a> publication of Hadley Wickham and received an error I cannot find any precise information about and I cannot deal with. Thank you in advance for any explanation / hint etc. </p> <p>An example code: </p> <pre><code>library(microbenchmark) f &lt;- function() NULL microbenchmark( NULL, f() ) </code></pre> <p>Console output:</p> <pre><code>Error in microbenchmark(NULL, f()) : Measured negative execution time! Please investigate and/or contact the package author. </code></pre> <p><strong>UPDATE.</strong> Here is my <code>seesionInfo()</code> console output:</p> <pre><code>&gt; sessionInfo() R version 3.0.2 (2013-09-25) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=Polish_Poland.1250 LC_CTYPE=Polish_Poland.1250 LC_MONETARY=Polish_Poland.1250 [4] LC_NUMERIC=C LC_TIME=Polish_Poland.1250 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] ggplot2_0.9.3.1 microbenchmark_1.3-0 loaded via a namespace (and not attached): [1] colorspace_1.2-4 dichromat_2.0-0 digest_0.6.3 grid_3.0.2 gtable_0.1.2 labeling_0.2 [7] MASS_7.3-29 munsell_0.4.2 plyr_1.8 proto_0.3-10 RColorBrewer_1.0-5 reshape2_1.2.2 [13] scales_0.2.3 stringr_0.6.2 tools_3.0.2 </code></pre> <p><strong>UPDATE 2.</strong> Some further information the author of the package asked me for: </p> <ul> <li><p>R variable <code>R.version</code></p> <blockquote> <p>R.version _<br> platform x86_64-w64-mingw32<br> arch x86_64<br> os mingw32<br> system x86_64, mingw32<br> status<br> major 3<br> minor 0.2<br> year 2013<br> month 09<br> day 25<br> svn rev 63987<br> language R<br> version.string R version 3.0.2 (2013-09-25) nickname Frisbee Sailing </p> </blockquote></li> <li><p>make, model and speed of the CPU in my computer:</p></li> </ul> <p>Processor: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz 3.70 GHz</p> <p>RAM: 16,0 GB</p> <p>System type: 64-bits </p> <p><strong>UPDATE 3.</strong> </p> <p>I have noticed that one of the modifications of the code above does return a correct result: </p> <pre><code>&gt; ### 1 &gt; f &lt;- function(){NULL} &gt; microbenchmark(NULL, f()) Error in microbenchmark(NULL, f()) : Measured negative execution time! Please investigate and/or contact the package author. &gt; &gt; &gt; ### 2 &gt; f &lt;- function(){ } &gt; microbenchmark(NULL, f()) Error in microbenchmark(NULL, f()) : Measured negative execution time! Please investigate and/or contact the package author. &gt; &gt; &gt; ### 3 &gt; f &lt;- function(){NULL} &gt; microbenchmark(f()) Unit: nanoseconds expr min lq median uq max neval f() 0 1 1 1 7245 100 &gt; &gt; ### 4 &gt; f &lt;- function(){ } &gt; microbenchmark(f()) Error in microbenchmark(f()) : Measured negative execution time! Please investigate and/or contact the package author. </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload