Using R in RapidMiner

z384zhan
z384zhan New Altair Community Member
edited November 5 in Community Q&A

I installed the Execute R script operator in RapidMIner. Everything works fine but I found the following code didn't work:

rm_main = function(dataset)
{
new_dataset = dataset[1,c(1,5)]
return new_dataset
}

Basically all the operations using "[]"  doesn't work properly. I understand this can be done by Select Attributes in RapidMIner, but is it my problem or such R syntax is not supported in RapidMIner?

Tagged:

Best Answer

  • z384zhan
    z384zhan New Altair Community Member
    Answer ✓

    Never mind. I passed a R data table instead of a data frame into the function. Although in R you can treat table as data frame but here you have to change it to an actual "data frame" using as.data.frame.matrix(dataset). Hope this is helpful to you guys.

Answers

  • z384zhan
    z384zhan New Altair Community Member
    Answer ✓

    Never mind. I passed a R data table instead of a data frame into the function. Although in R you can treat table as data frame but here you have to change it to an actual "data frame" using as.data.frame.matrix(dataset). Hope this is helpful to you guys.