I am trying to use googleVis to display my result with R studio and markdown.
I had no problem producing the default Fruits data into motionchart using markdown but when I try to use my own data, markdown refuses to attach it correctly.
After
print(M, "chart")
is run, I get
## <!-- MotionChart generated in R 2.15.0 by googleVis 0.2.16 package -->
## <!-- Thu Jun 07 09:20:56 2012 -->
##
##
## <!-- jsHeader -->
## <script type="text/javascript" src="http://www.google.com/jsapi">
## </script>
## <script type="text/javascript">
.. and so on until
## <!-- divChart -->
##
## <div id="MotionChartIDa7c4ac2425a"
## style="width: 600px; height: 500px;">
## </div>
I simply don’t get why this would not be attached automatically but instead is displaying just the R output. What am I missing out here?
You are probably starting your codeblock with
You need to start it instead with
That will tell it that the output of the codeblock is pure HTML that should be appended directly into the document.