ERROR R Snippet Execute failed: Could not parse REXP
Hello, all.
Please help with some issue. In my table I have 2 fields: “firstdate” and “currentdate”. Also I have function “workdayscount” in postgresql database which counts number of business days between two dates.
I try to run in R Snippet next code:
"library(“RPostgreSQL”)
drv <- dbDriver(“PostgreSQL”)
passw <- “pass”
con <- dbConnect(drv, dbname = “dbname”,
host = “111.111.111.1”, port = 5432,
user = “user”, password = passw)
work_days <- function(row){
days <- dbGetQuery(conn = con, statement = paste0(“select workdayscount(’”, row[[“firstdate”]], “’,’”, row[[“currentdate”]],"’)"))
return(days)
}
knime.in$workdays <- apply(knime.in, 1, work_days)
dbDisconnect(con)
knime.out <- knime.in"
It works without issues when I press button “Eval script” in R Snippet window. But when I try to execute node I get error “Execute failed: Could not parse REXP”.
Can anyone help me?