title: Streaming data visualization in R
body: <p>It looks simple but am struggling with it. Basically I am trying to visualize (plot) a simulated streaming data that comes in every two seconds i.e. for the plot to be continuous in real-time. </p>
  
  <p>I have seen Microsoft Azure (but i don't have the expensive subscription). I have also seen the Animation package but it has to read in all the data before rendering the display. Is there a way to achieve this in R (or perhaps python)?
      This is what I have done so far in R:</p>
  
  <pre><code>    #simulate some sensor data
  time &lt;- seq(1,200,2)
  sensor &lt;- runif(100,1,100)
  timedf &lt;- data.frame(cbind(time,sensor))
  timedf$time &lt;- as.POSIXct(timedf$time,origin = "2016-05-05")
  
  plot(timedf$time,timedf$sensor,type = "l")
  
  #I want to visualize or plot the data continously every 2 seconds
  #sleep function
  mysleep &lt;- function(x)
  {
    p1 &lt;- proc.time()
    Sys.sleep(x)
    proc.time() - p1 
  }
  
  for(i in 1:nrow(timedf)){ 
    mysleep(2)
    print(timedf[i,])
    plot(timedf[i,]$time,timedf[i,]$sensor,type = "l")
    par(new=FALSE)
  }[![some sensor data][1]][1]
  </code></pre>