首页 > 解决方案 > taskscheduleR:找不到函数“as”

问题描述

我正在尝试使用 RStudio 中的 taskscheduleR 插件每周运行脚本。我每次都变成同样的错误:找不到函数“as”。

Quitting from lines 25-83 (association_analysis.Rmd)
Fehler in as(dataToTrans, "transactions") :
konnte Funktion "as" nicht finden
Ruft auf: render ... handle -> withCallingHandlers -> withVisible -> eval -> eval

R脚本的一部分,错误抛出的地方:

library('arules')
#create transactions
transactions <- as(dataToTrans, "transactions")
inspect(head(transactions))

当我在 RStudio 中运行脚本时,它可以完美运行,但不能使用 taskscheduleR。知道我怎样才能让它工作吗?

标签: rrstudiotaskschedulerrscript

解决方案


尝试添加

library(methods)

到.Rmd,因为as是这个包中的一个函数。


推荐阅读