microbenchmark Rパッケージの機能のいくつかを知るようになりました。Hadley Wickham のこの出版物からサンプル コードを実装したところ、正確な情報が見つからず、対処できないエラーが表示されました。説明/ヒントなどをよろしくお願いします。
コード例:
library(microbenchmark)
f <- function() NULL
microbenchmark(
NULL,
f()
)
コンソール出力:
Error in microbenchmark(NULL, f()) :
Measured negative execution time! Please investigate and/or contact the package author.
アップデート。これが私のseesionInfo()コンソール出力です:
> 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
UPDATE 2.パッケージの作成者が私に求めた詳細情報:
R変数
R.versionR.version _
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 0.2
year 2013
month 09
day 25
svn rev 63987
language R
version.string R version 3.0.2 (2013-09-25) ニックネームフリスビーセーリングコンピューターの CPU のメーカー、モデル、および速度:
プロセッサ: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz 3.70 GHz
RAM: 16.0GB
システム タイプ: 64 ビット
更新 3。
上記のコードの変更の 1 つが正しい結果を返すことに気付きました。
> ### 1
> f <- function(){NULL}
> microbenchmark(NULL, f())
Error in microbenchmark(NULL, f()) :
Measured negative execution time! Please investigate and/or contact the package author.
>
>
> ### 2
> f <- function(){ }
> microbenchmark(NULL, f())
Error in microbenchmark(NULL, f()) :
Measured negative execution time! Please investigate and/or contact the package author.
>
>
> ### 3
> f <- function(){NULL}
> microbenchmark(f())
Unit: nanoseconds
expr min lq median uq max neval
f() 0 1 1 1 7245 100
>
> ### 4
> f <- function(){ }
> microbenchmark(f())
Error in microbenchmark(f()) :
Measured negative execution time! Please investigate and/or contact the package author.