R Snippet output error

I’m having a perplexing error for an R Snippet node. The error I’m getting is:

Execute failed: class org.knime.filehandling.core.data.location.cell.SimpleFSLocationCell cannot be cast to class org.knime.core.data.StringValue (org.knime.filehandling.core.data.location.cell.SimpleFSLocationCell is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @689187df; org.knime.core.data.StringValue is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @615e83ac)

The code is:

library(tidyverse)

library(dplyr)

library(tidyr)

library(janitor)

library(data.table)

data_date ← c(‘2024-01-17’,‘2024-01-24’,‘2024-01-31’,‘2024-02-07’,‘2024-02-14’,‘2024-02-21’,‘2024-02-26’,‘2024-03-06’,‘2024-03-13’,‘2024-03-20’)

lstfolder ← paste0(“C:\Docs\Data Science\Refresh”,data_date)

fillocat<- lstfolder[10] #“C:\Docs\Data Science\Refresh_2024-03-06”

filesload ← list.files(path = fillocat, pattern = “*.csv”, full.names = TRUE)

combfile ← filesload %>% mapdf(~readcsv(.,colnames=TRUE,id=‘path’ )) %>% bindrows() %>% clean_names() %>% subset(select = -c(path))

knime.out ← comb_file %>% data.table()

I’ve executed line by line with no issues. The default data structure formed was a “tbldf” for combfile and I know knime.out requires either a data frame, a table, a list or a matrix.

combfile is a data table as I verified it with an additional line casting it to data.table() and assigning it back to combfil and looking at it within the snippet workspace it looks fine and says it’s a data.table.

I’ve tried casting comb_file as a data.frame as well with the same error.

Quite confused if the workspace shows the variable is a data.table and knime.out accepts a data table, why it’s not sending the variable to the output.