Hi, make sure your data is in a data frame: Data <- data.frame(t,can2p,code) just specify in which object you find those specific variables by using object$ before each one. I hope this solve the problem. If not, post your script, it's really hard to work with only an error message! Cheers JM