arendsee / rmonad

Pipelines you can compute on
70 stars 0 forks source link

Doc and error msg in the plot #20

Closed j23414 closed 5 years ago

j23414 commented 5 years ago

Given a monad m, why can't I plot the documentation and error messages? Am I missing something?

The following commands work individually:

plot(m, label=get_doc)
plot(m, label=get_error)

01

But when I use

plot(m,label=paste(get_doc,get_error,sep=":"))

I get error msg

Error in paste(get_doc, get_error, sep = ":") : 
  cannot coerce type 'closure' to vector of type 'character'
arendsee commented 5 years ago

The label argument is expecting a function of an Rmonad object. So what you want is this:

plot(m, label=function(m){paste(get_code(m), get_error(m), sep=":")})

Let me know if this works for you.

j23414 commented 5 years ago

Works, thanks!

03

arendsee commented 5 years ago

Cool! Merry Christmas!

Though it would make a nicer diagram if we could get nodes to scale independently with the size of the text. I used to use DiagrammeR by default in the graphs. That made way prettier plots. Maybe we could add it back?