Search code examples
rgooglevis

Generate chart as an html file with custom name


I like to create bunch of googleVis charts and one I create the charts, I like to create a different html files with custom names so that I can reference them in my front page with divs.

For example, I am doing this:

x <- gvisTable(mtcars)
writeLines(x, "cars.html")

I get this error:

Error in writeLines(x, "cars.html") : invalid 'text' argument

Ideas how would I address this problem?


Solution

  • I got the answer, I can simply to this and write it to any html file I like:

    cat(x$html$chart, file="tmp.html")