I would like to plot last observation from my data.frame in different colour/shape. Now, one close entry about this topic is here at SO but not exactly what I need. This solution I'm posting here works, but I would be glad to have also other option/ways to deal with this matter within lattice as this seems clumsy somewhat to me.
Sample data:
set.seed(123)
data <- data.frame(x=rnorm(10,0,1),y=rnorm(10,1,2))
n <- nrow(data)
plot1 <- xyplot(x~y, data, col=ifelse(data$x==(data$x[n]), "red", "black"),
pch=ifelse(data$x==(data$x[n]), 19, 1), cex=ifelse(data$x==(data$x[n]), 2, 1))
print(plot1)
EDIT: Also the above solution seems not to work if the last two observations are exactly the same. And this is what I'm having in my data occasionally.