Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you want to do an animation then there is the animation package, or an animate contrel for the GUI created using the <code>tkexamp</code> function in the TeachingDemos package. You could enhance the animation by plotting the last several points with a color gradient using <code>color.scale.lines</code> from the plotrix package.</p> <p>Here is an example:</p> <pre><code>library(TeachingDemos) library(plotrix) tmpfun &lt;- function(start,numpoints=10) { plot(ccc$Lon,ccc$Lat, xlab='Longitute', ylab='Lattitude', type='n') to &lt;- min(nrow(ccc), start+numpoints) color.scale.lines( ccc$Lon[start:to], ccc$Lat[start:to], c(0.7,0), c(0.7,0), c(0.7,0), colvar=seq_len(numpoints) ) } tmplist &lt;- list( numpoints=list('spinbox', init=10, from=1, to=nrow(ccc)), start=list('animate',init=1, from=1, to=nrow(ccc)) ) tkexamp( tmpfun, tmplist ) </code></pre> <p>Here is a second example that takes time into account:</p> <pre><code>tmpfun2 &lt;- function(start, dur=120) { time &lt;- as.numeric(h2h$Time3) fr &lt;- which( time &gt;= start )[1] if( is.na(fr) ) fr &lt;- nrow(h2h)-1 to &lt;- which( time &gt;= start+dur )[1] if( is.na(to) ) to &lt;- nrow(h2h) plot(h2h$Lon, h2h$Lat, xlab='Longitute', ylab='Lattitude', type='n', main=paste('Times',time[fr],'to',time[to]) ) color.scale.lines( h2h$Lon[fr:to], h2h$Lat[fr:to], c(0.7,0), c(0.7,0), c(0.7,0), colvar=time[fr:to]) } tmplist2 &lt;- list( dur=list('spinbox', init=120, from=10, to=1200), start=list('animate',init=0, from=0, to=1780, delay=100, resolution=10) ) tkexamp( tmpfun2, tmplist2 ) </code></pre> <p>Playing around with the colors in either example may give a more meaningful color gradient.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload