R script node change Date to Double


I code a R script using the node R snippet. This script outputs a data,table with many variables.

I have a column inside this data.table called Date with values like: ‘2018-07-20’,‘2018-07-21’… all of these values are Date type ( I checked that executing the R snippet inside of the node) . I save this table in the knime.out.

The problem is that in the knime.out this column is transformed to double type and I do not know why.

Any ideas?


There has been a quite similar discussion

So far I was only able to extract Date values from R as either Strings or Unix Timestamps which are somewhat uncomfortable to handle in KNIME later. As you ca see in the example within R they are stored as dates but once you bring them back to KNIME they are either strings or UNIX Timestamps.

Another attempt could be to store the date as a long variable in the form of
(year * 1000) + (month * 100) + day
2018-06-01 => 20180601

I use R 3.4.4 since I am not sure the RServe bug with KNIME and R 3.5 has been solved.

kn_example_r_date2.knwf (58.3 KB)