Thanks a lot for your suggestions. Referencing the dataset solved the
problem. I had actually tried it before but since I was also subsetting the
datset within the function (something I didn't mention in my question) the
objects were not of the same length and that caused me trouble. Your comment
made me realize that.

Thanks Hadley for pointing me out to ggplot2, looks like a very complete
graphics package and if it simplifies the programming it must be extremely
useful. I'll make sure to take a closer look at it.

Best regards,

Diego

	[[alternative HTML version deleted]]

