The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Why date data is missing after output from Execute R
Hi
I am trying to pass the data table to Execute R, and want to get back with extra additional attributes generated by R. But when I pass data table to Execute R and get the out put form Execute R, found out that Date attribute is missing.
1. Save the data in local repositiory with date data type.
2. Just simply multiply (output directly and the other pass to Execute R)
3. Simple do nothing Execute R script
4. Output from R script
5. Output from direct Multiply
Anyone could give me an advice, how I can get the data table as it is from Execute R Script.
Thanks.
Tagged:
0
Answers
hello @zeno_mas - could you please post your process so we can take a look at it? Please use the </> tool above.
Thanks.
Scott
@sgenzer Thanks for the quick.
Try converting your date column from a RapidMiner Date type to Polynominal type.
Sometimes when converting from RM > R, the date times get wonky.
Thank you for your suggestion @Thomas_Ott.
Yep, that is one of the workable workaround, in fact I actually started with that and inside Excute R still can detact as date data type.
Do you think it is worth to report an issue to RM team?
Rgds,
hi @zeno_mas - just curious. What are you trying to do in R that cannot be done with RapidMiner operators?
Scott
Hi @sgenzer,
I know the post is old but I had a similar problem.
After running a simple R script where the input example set contains a Date time attribute, I get the following error:
The same error occured when using Date attributes. When I convert the date attribute to nominal, the problem is solved. I'm just getting started with the "Execute R" operator and in this process I used it to simply output the ExampleSet to the RapidMiner results.
My process is as follows:
The reason I'm using R is that I want to perform STL (Seasonal and Trend decomposition using Loess) on a time series and I didn't find a relevant operator in RapidMiner.
Thanks,
John
Hi @imarkou,
Just a small teaser concerning the STL Decomposition. With the next release of RapidMiner Studio we will add an operator capable of performing STL.
Best regards,
Fabian
Hi @tftemme,
Great to hear that! It will be interesting to give it a try when it's released!
Regarding the problem, as @Thomas_Ott and @zeno_mas mentioned, converting date into polynominal is a solution to the problem. Even when converting date time to polynominal, R recognises the data as POSIXct which is what I wanted for analysing time series data.
However, I was wondering if the exception in my process is because I'm trying to pass data that is not supported by the Execute R operator or due to a bug.
Best regards,
John
cc'ing our resident R expert @yyhuang
Hi @imarkou,
Thanks for the followup.
As you said R recognises the data as POSIXct. The special classes for date and time in R are C-based. While the date class in RapidMiner is Java based.
See also about the issues when you convert dates between different systems
https://www.rdocumentation.org/packages/base/versions/3.5.1/topics/as.Date
we suggest you use as.character() function to covert date to characters.
Page 8 on this R news gives detailed explaination about the development of date class in R.
Example process:
YY
Thanks a lot for the detailed explanation @yyhuang!