タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

rとdebugに関するmanabouのブックマーク (2)

  • R言語 - デバッグやボトルネックを発見するテクニック - Qiita

    はじめに R に限った話ではありませんが、プログラミングでは、変数に意図した値が格納されていることを確認したり、むやみに時間のかかるプログラミングになっていないかを確認することがあります。R にも、デバッグやボトルネックを見つけるテクニックがあります。 browser 関数を使ったデバッグ手法 関数内でのデバッグを有効にするには browser() 関数を使います。次の例は、引数で与えられた数値に対して、和差積商を計算するユーザー関数に、browser()関数を使用したサンプルスクリプトです。デバッグ実行の開始条件として、「一番目の引数が 8 以上」ということを browser() 関数に指定しています。 関数の作成 ▼サンプルスクリプト func_calc <- function(x,y){ + a <- x + b <- y + browser(expr = x <= 8) + pri

    R言語 - デバッグやボトルネックを発見するテクニック - Qiita
  • Debugging in R

    These web pages describe various issues involved in debugging code written for the open source statistical package R. It is particularly aimed at Windows programmers, but many of the techniques work more widely. For instructions particular to other platforms, and non-compiler-specific details, see the Writing R Extensions manual in the docs subdirectory of the R installation. The cat() and print()

  • 1