LoginSignup
3
3

More than 5 years have passed since last update.

Rで実行時間を計測して出力する

Posted at

RStudioのKnit HTMLの結果に表示した

参考:R FAQ 'How can I time my code?'
RStudioでKnit HTML

RMarkdownのコード例


計測開始

\```{r, echo=FALSE}
ptm <- proc.time()
\```

\```{r}
print('Do some long time calculation')
Sys.sleep(15)
\```

計測終了

\```{r, echo=FALSE}
proc.time() - ptm
\```

※backtickのエスケープがよくわからないので \ を入れている

結果

r_proc.time.png

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3