This is not a bug, just as said in the help it expects a JSON string so you need to build JSON string.
Using RJSONIO
you can build the JSON option using toJSON
library(googleVis)
library(RJSONIO)
myColor <- 'grey' ## my dynamic color, here I fix but you can read it ,e.g
## from a chart config file or whatever you want
isLegend <- TRUE ## a boolean value
myseriesOptions <- toJSON(list(list(color=myColor),list(visibleInLegend=isLegend)))
For example
Scatter2 <- gvisScatterChart(women,
options=list(legend="none",
lineWidth=2, pointSize=0,
title="Women", vAxis="{title:'weight (lbs)'}",
hAxis="{title:'height (in)'}",
width=300, height=300,
series = myseriesOptions ))
plot(Scatter2)
PS : We can use fromJSON
to get the R form of the string to construct, e.g
fromJSON("{title:'mytitle'}") ## the ouptut is a list
$itl
NULL
cat(toJSON(list(title='mytitle'))) ## I construct my list and I use toJSON
## I get my origin json form
{
"title": "mytitle"
}