R Snippet: Data frame to Time Series

Hi Guys!

I'm having problems to transform and create a time series using R Snippet.

Here is what I have been trying:

-I have 2 columns: Website Sessions and Date+Hour

-I transformed the Date+Hour column as bellow and looks ok:

    > datehour<-as.POSIXct(knime.in$"DATE+HOUR_time",format="%Y-%m-%dT%H")
    + head(datehour)

     [1] "2016-01-01 00:00:00 CET" "2016-01-01 01:00:00 CET"
     [3] "2016-01-01 02:00:00 CET" "2016-01-01 03:00:00 CET"
     [5] "2016-01-01 04:00:00 CET" "2016-01-01 05:00:00 CET"

-I'm trying to create a time series now using those 2 columns:

     knime.out<-as.ts(knime.in$"Sessions",datehour)

     execute failed: CODING PROBLEM    importBufferedDataTable(): Supporting only 'data.frame', 'matrix' and 'list' for type of "knime.out" (was 'ts').

How can I create dataset for Time Series analysis using R in Knime?

Thanks!

Hi Fabio,

I believe that knime.out must be of 'data.frame' type. In your case it is 'ts' type. If you can massage your R data into a data frame then you'll be able to export the time series as a string column. You'll then be able to use the string to date/time nodes in the Analytics Platform to convert the string to a KNIME date/time column.

Best,

Jon

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.