title: Plotting World Bank data: the condition has length > 1
body: <p>I'm trying to plot some World Bank data using the googleVis package for R but it gives me the following error:</p>
  
  <pre><code>In if (class(x[[.x]]) == "Date") as.character(x[[.x]]) else x[[.x]] :
  the condition has length &gt; 1 and only the first element will be used
  </code></pre>
  
  <p>I've used the following code:</p>
  
  <pre><code># load the packages
  library(WDI) # package for importing World Bank data
  library(plm) # package for working with panel data
  library(googleVis) # the googleVis package
  
  # import the data using the WDI package
  LONG &lt;- WDI(country=c("AGO","BEN","BWA","BFA","BDI"), indicator=c("SP.DYN.CBRT.IN",
  "SP.DYN.TFRT.IN", "SP.POP.TOTL", "NY.GDP.PCAP.KN"), start=2005, end=2009, 
  extra=FALSE)
  
  # transform to panel format and encode the year variable as numeric
  PANEL &lt;- pdata.frame(LONG, c("country","year"))
  PANEL$year &lt;- as.numeric(as.character(PANEL$year))
  
  # plot in a MotionChart using googleVis
  MC &lt;- gvisMotionChart(PANEL, idvar="country", timevar="year")
  plot(MC)
  </code></pre>
  
  <p>Does anybody know why this is?</p>