I am periodically getting the error "Error: cannot assign 'tsp' to zero-length vector" in a loop using the R Snippet to do AdStock calculations. It seems like a glitch because sometimes it can execute on the same data set without problems and when the error occurs, reseting the node clears the error and then it can run successfully. Any idea what the cause of this is or how to automate the "reset" inside my wrapped node? This wrapped node sits inside a loop which sits inside another loop. I tried using the Try-Catch learner to just keep the loop going, but it does not work because of a flow variable conflict and unfortunately the flow variables are needed for the RSnippet. I am new to R and can't find what the error means.
My R Script:
knime.in$"Current Column_ASAdStock" <-filter(x=knime.in$"Current Column", filter=knime.flow.in[["AdStock"]], method="recursive")
knime.out <- knime.in
"Current Column" values are all double values with no missing values. No column is exclusively 0s. "AdStock" is a value between 0.1 - 0.9