パッケージ化された関数func
の本体を一時的に編集するには、よくtrace(func, edit=TRUE)
を使用します。なぜトレース(...、編集= TRUE)が機能しないのか... = [.data.table
## Note: In this and the other cases below, once an editor pops up, I save and
## and then exit without making any edits to the function. The commented-out
## message below each call to trace() is what is then printed to my R console.
trace("[.data.table", where=data.table, edit=TRUE)
# Error in .makeTracedFunction(def, tracer, exit, at, print, doEdit) :
# the editing in trace() can only change the body of the function, not
# the arguments or defaults
質問:このエラーを引き起こしている可能性がありますどのようないくつかの理由については、しかし、Rはfunc
が[.data.table
ときに私はこれを実行させないのか?他のどの機能もそれを引き起こしますか?そのような機能のために、私はそれらを編集することができるいくつかの代替回避策がありますか?
FWIW、これはdata.tableの名前空間の機能といくつかの一般的な問題ではないようです(下記例えば#1
を参照)また、それは、(例えば#2
下記参照)一般的なサブセットの方法に問題があります。
## (#1)
trace("within.data.table", where=data.table, edit=TRUE)
# Tracing function "within.data.table" as seen from package "data.table"
# [1] "within.data.table"
## (#2)
trace("[.Date", edit=TRUE)
# Tracing function "[.Date" in package "base"
# [1] "[.Date"
私は、Windows XPマシン上でR-3.0.0
とdata.table_1.8.8
を実行している、と私はセットoptions(editor="emacs")
、options(editor="notepad")
を使用するか、またはR GUIのデフォルトのエディタを使用するかどうか、同じエラーを取得しています。
それはdata.table_1.8.6と2.15.3、Windows 7の –
に私の作品しかし、私は1.8.8にアップグレードした後、同じエラーが出ます。 –
@MatthewPlourde - ありがとう!それは本当に問題の絞り込みに役立ちます。 –