Reputation: 11
I am trying to use the taskscheduleR add-in in RStudio to run a script weekly. Every time I get the same error:
cannot find the function "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
The part of R script, where the error is throwing:
library('arules')
#create transactions
transactions <- as(dataToTrans, "transactions")
inspect(head(transactions))
It works when I run the script in RStudio, but not with taskscheduleR. Any idea how I can make it work?
Upvotes: 1
Views: 119
Reputation: 18500
Try to add
library(methods)
to the .Rmd, since as
is a function from this package.
Upvotes: 1