Hi, thanks for your quick answers! These solve my problem. Now I have another question. I think I can use head(y, -1) instead of y[-length(y)] Are there differences in terms of performance? Best regards Joseph