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
"R scripts"
Hello,
pardon my ignorance but I can seem to import a dataset and do a simle computation on this dataset using the "Execute R script" operator.
- First, can I connect any RM datset directly to the R operator?
- Is the logic behind the input that if I name it "MyData" I can reference to any variable from this dataset with the normal "MyData$variable_name" command? Ie. how it would be done in R.
- I try to do this but since it is a bit difficult to follow the very brief tutorial video I cannot understand what I'm doing wrong: all I get is an error "The data delivered by R in the variable {0} was not in the correct format for importing as an ExampleSet"
Thanks in advance,
Frankie
pardon my ignorance but I can seem to import a dataset and do a simle computation on this dataset using the "Execute R script" operator.
- First, can I connect any RM datset directly to the R operator?
- Is the logic behind the input that if I name it "MyData" I can reference to any variable from this dataset with the normal "MyData$variable_name" command? Ie. how it would be done in R.
- I try to do this but since it is a bit difficult to follow the very brief tutorial video I cannot understand what I'm doing wrong: all I get is an error "The data delivered by R in the variable {0} was not in the correct format for importing as an ExampleSet"
Thanks in advance,
Frankie
Tagged:
0
Answers
that's what the operator is designed for.
You can export all data sets, but R might see the data in a different way. For example the time attribute will be exported as milliseconds after 1980 I think. So you have to be cautious about this.
The data is then exported as a data frame under the variable name you enter. If you name it "MyData" you can use the normal methods of accessing a data frame called "MyData" in R.
If you are again importing Data from the R Script, the given name of the variable must reference a DataFrame containing only Vectors and Factors. If the variable is called "MyImport" you can define "MyImport.label", too, which might refer to the column name that is used as label.
Greetings,
Sebastian
I've been trying to build a simple process that:
1. Retrieve the Iris dataset that comes bundled with RM
2. Use R code to sum two of the variables, say a1+a2
Thanks
sure, no problem. Here you go: Cheers,
Ingo