R Functions in Execute R Script RRS feed

  • Question

  • Hello, much appreciated if the learned ones can help me here.

    I followed the excellent quick start by Blackmist.

    My R script uses the function from igraph to turn the data frame into a graph object and it throws an error 0063  Error: Mapped variable must be of class type data.frame at this time.

    Does this mean the my data frame in ML is not the same type of data frame as in R? 

    In R
    sample1<-read.csv("File Location")

    In ML

    Monday, February 23, 2015 9:32 AM


  • Hi,

    The problem is that you can only return objects where "" is true and graph data frames from the igraph library do not have this property.

    Here are a couple of work arounds:

    2. To return arbitrary R objects as data.frames, you can serialize
    them into a byte array using:,con=NULL))); <o:p></o:p>

    3. Alternatively, igraph provides a function, to
    get the edge and vertex information as data frames. So you can do something
    like this:<o:p></o:p>

    vertices <-, what="vertices")

    edges <-, what="edges")

    Each of these are a data.frame you can return them individually from the Execute R Script module.

    Does this help?


    Monday, February 23, 2015 9:13 PM