Rookie question, I think.
I’m just trying to replicate this:
http://rpubs.com/gallery/googleVis
Open a new markdown document (in Rstudio), paste:
suppressPackageStartupMessages(library(googleVis))
T <- gvisTable(Exports, options = list(width = 200, height = 280))
G <- gvisGeoChart(Exports, locationvar = "Country", colorvar = "Profit",
options = list(width = 360, height = 280, dataMode = "regions"))
TG <- gvisMerge(T, G, horizontal = TRUE, tableOptions = "bgcolor=\"#CCCCCC\" cellspacing=10")
print(TG, "chart")
Between the “`{r} tags.
The resulting output (from the print function) is just the javascript (I think) code. It’s not actually drawing the plot, in the preview window or the online version after publishing.
Is something else needed in the markdown? Like:
“`{r something=something}
To get it to interpret the output from the print command properly?
Thanks
ANSWER
“`{r anythingyoulike, results=’asis’}
The top of this post
http://rpubs.com/gallery/googleVis really should point that out imo…
something like “`{r results=’asis’}. However I don’t have knitr manual with me now so you need to check.