title: gvisMotionChart: change the default variables
body: <p>I have a <code>data.frame</code> <code>df</code> that consists of fours sites (1 to 4). Each site has values for four parameters (A to D) from 2011 to 2014. I want to create a motion chart for site1.</p>
  
  <pre><code>library(dplyr)
  siteID &lt;- c(rep("site1", 16), rep("site2", 16), rep("site3", 16), rep("site4", 16))
  YEAR &lt;-   as.numeric(rep(c("2011", "2012", "2013", "2014"), 16))
  parameter &lt;- c(rep("A", 4), rep("B", 4), rep("C", 4), rep("D", 4),
                 rep("A", 4), rep("B", 4), rep("C", 4), rep("D", 4),
                 rep("A", 4), rep("B", 4), rep("C", 4), rep("D", 4),
                 rep("A", 4), rep("B", 4), rep("C", 4), rep("D", 4))
  value &lt;- c(seq(1, 4, by=1), seq(10, 40, by=10), seq(12, 18, by=2), seq(5, 20, by=5),
             seq(3, 12, by=3), sample(13:18, 4), sample(15:22, 4), sample(10:18, 4),
             seq(7, 1, by=-2), sample(15:22, 4), sample(15:19, 4), sample(10:20, 4),
             seq(8, 5, by=-1), seq(50, 20, by=-10), seq(16, 10, by=-2), seq(20, 5, by=-5))
  df &lt;- data.frame(siteID, YEAR, parameter, value)
  df$YEAR &lt;- as.numeric(df$YEAR)
  
  df1 &lt;- df %&gt;%
    dplyr::filter(siteID =="site1")
  </code></pre>
  
  <p>I created the motion chart for site 1 using the following code</p>
  
  <pre><code>library(googleVis)
  site1 = gvisMotionChart(data=df1, 
                           idvar="parameter", 
                           timevar="YEAR",
                           chartid="site1")
  plot(site1)
  </code></pre>
  
  <p>It worked fine. The result is here</p>
  
  <p><a href="https://i.stack.imgur.com/yc0Cr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yc0Cr.png" alt="enter image description here"></a> </p>
  
  <p>However, the default <code>x axis</code> and <code>y axis</code> were <code>value</code>. I had to change <code>x axis</code> myself from value to YEAR.</p>
  
  <p>I wanted to change the default values so that <code>x-axis</code> will be <code>YEAR</code>, <code>colorvar</code> will be <code>parameter</code>, and <code>sizevar</code> will be <code>value</code>. I did that using this code</p>
  
  <pre><code>site1_1 = gvisMotionChart(data=df1, 
                           idvar="parameter", 
                           timevar="YEAR",
                           chartid="site1",
                           xvar="YEAR", 
                           yvar="value",
                           colorvar="parameter", 
                           sizevar="value")
  
  plot(site1_1)
  </code></pre>
  
  <p>It kept showing as loading but the plot was not created.
  Any suggestions would be appreciated.</p>