2011-08-16 8 views
5

以前に問題なく動作していたマイコードが、dcast式を呼び出すときにクラッシュしました。周りを遊んだ後、私はdcastのヘルプページからの最小限の例でさえも私のためにはうまくいきません。より正確には:reshape2ヘルプページの例を実行中のエラーメッセージ

#Air quality example 
names(airquality) <- tolower(names(airquality)) 
aqm <- melt(airquality, id=c("month", "day"), na.rm=TRUE) 

acast(aqm, day ~ month ~ variable) 
acast(aqm, month ~ variable, mean) 

最後の行には、次のエラーを生成します。ここでは

Error in vaggregate(.value = value, .group = overall, .fun = fun.aggregate, : 
    could not find function ".fun" 

)が(私のSessionInfoです:

R version 2.13.1 (2011-07-08) 
Platform: x86_64-pc-mingw32/x64 (64-bit) 

locale: 
[1] C 

attached base packages: 
[1] grid  stats  graphics grDevices utils  datasets methods base  

other attached packages: 
[1] ggplot2_0.8.9 proto_0.3-9.2 reshape2_1.1 xtable_1.5-6 reshape_0.8.4 plyr_1.5.2  lubridate_0.2.5 

loaded via a namespace (and not attached): 
[1] stringr_0.5 tools_2.13.1 

私は満足の行く答えを思い付くしていませんここで何がうまくいかないので、私はいくつかの助けに感謝します。また、私はstackoverflow上で、次のスレッドが見つかりました:Similar problem この問題は、カスタム関数から発生するようです。しかし、私は標準的な平均関数とヘルプページの標準例を使用します。

更新:ちょっとしたインターネット調査をしただけで、reshape2パッケージのアップデートに関する情報が見つかりませんでした。これは、私が問題に関して持っていた最高の推測でした。

UPDATE2:Rセッション中にstatiscticの例で遊んでいる間に私がおそらく平均関数を再割り当てしたために問題が発生しました。 Rを再起動すると問題が解決しました。今、すべてが再び期待どおりに機能します。完全のために

+0

これは私のために正常に動作し、私は私たちの間で見ることができる唯一の識別可能な違いシステムは私がOS Xにいるということです。 – joran

+1

私のためにうまく動作します。私はwin64でもR 2.13.1を持っています... search()の出力は何ですか? – Tommy

+0

'plyr_1.5.2 stringr_0.5 tools_2.13.1'、' reshape2_1.1'、 'R version 2.13.1 Patched(2011-07-13 r56380)'でFedora 14 Linuxもうまく動作します。 –

答えて

5

PaulHurleyukさんのコメント:

Have you tried restarting R and trying the example in a fresh session ? Or do rm(list=ls()) to remove everything from the current session. In the past I have managed to break things by assigning something to something that shouldn't be assigned to.

Christoph_Jの応答:

Thanks ... that was exactly the problem...

The problem occurred because I most probably reassigned the mean function while I was playing around with a statisctic example during an R session. Restarting R solved the problem. Now, everything works as expected again.

関連する問題