taskscheduleR: cannot find the function "as"

124 Views Asked by At

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?

1

There are 1 best solutions below

0
On

Try to add

library(methods)

to the .Rmd, since as is a function from this package.