嘗試在內部傳遞函式memosie時出現錯誤,
Error in FUN(X[[i]], ...) : object 'condition' not found但如果單獨運行,則作業正常
這實際上是我閃亮的應用程式中的示例函式我也遇到了同樣的錯誤
library(ggplot2)
meansdf <- data.frame(means = c(13.8, 14.8), condition = 1:2)
testplot <- function(df, x, y) {
arg <- match.call()
scale <- 0.5
p <- ggplot(df, aes(x = eval(arg$x),
y = eval(arg$y) * scale,
fill = eval(arg$x)))
p geom_bar(position = "dodge", stat = "identity")
}
a = memoise::memoise(testplot)
a(meansdf, condition, means)
uj5u.com熱心網友回復:
采用,
a(meansdf, meansdf$condition, meansdf$means)

轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/450643.html
下一篇:張量流中具有復指數的自定義梯度
