hello Rui, Many thanks. That really helped me.you are totally right about[[4]] -- View this message in context: http://r.789695.n4.nabble.com/How-to-merge-two-functions-into-one-tp4659365p4659446.html Sent from the R help mailing list archive at Nabble.com.