gvisSankey titles of the axes are not appearing when using options=list(vAxes="[{title:'val1'}, {title:'val2'}]")

61 Views Asked by At

I am trying to draw a sankey diagram with gvisSankey. All the options i put under options=list .. are working well except for the axes titles (vaxes). As in i see the diagram and colors choses except the names of the axes.

Anyone has a solution for this?

thanks M


 f <- gvisSankey(data,from="val1",to="val1",weight="weight",
                 options=list(vAxes="[{title:'val1'}, {title:'val2'}]"))
 plot(f)
1

There are 1 best solutions below

1
Chaquita411 On

One answer I could think of is that the "vAxes" argument isn't an R-argument and you have to specify it in JavaScript (JS) style. Something like

options = list(sankey = "{vAxes = '[{title:'val1'}, {title:'val2'}]'))}")

This way the options that are specifically made for JS are read in via JS.