str(blue162)
seq.cols <- topo.colors(nrow(blue162))
#I jitter locations so overlapping points can be seen
plot(jitter(blue162$long,amount = 4),jitter(blue162$lat,amount = 4),
bg = seq.cols,cex = 2,pch = 21,xlab = "Longitude",ylab = "Latitude",
main = "Spatial locations of bluegrouse \nshowing temporal ordering of observations")
for(i in 1:length(seq.cols)){
rect(max(blue162$long)-10,min(blue162$lat)+10*(i-1),
max(blue162$long),min(blue162$lat)+10*(i),col = seq.cols[i],lty="blank")
text(max(blue162$long)-15,min(blue162$lat)+10*(i-1)+5,label=i)
}
text(max(blue162$long)-20,min(blue162$lat)+130,
label = "time order of \nobservations")
Run the code above in your browser using DataLab