```r
plotUpToDay <- function(bear, day, ...){
	plotRGB(heikki.basemap)
	b <- subset(bear, yday(datetime) <= day) 
	lines(b$x, b$y, col = "darkblue", lwd = 2)
	with(b, points(x, y, pch = 21, bg = rgb(seq(0.5,1,length = nrow(b)), 0, 
	                                        seq(1,0.3,length = nrow(b)))))
	with(b[nrow(b),], points(x, y, pch = 21, bg = "yellow", col = "red", cex = 2, lwd = 1.5))
	title(b$date[nrow(b)])
}
plotUpToDay(heikki2003, 200)
```

<img src="codigoParaAnimaciones_files/figure-html/unnamed-chunk-17-1.png" width="672" />