Preserve and restore data in R

Hi Sir,

Thank you for your reply.

Indeed, I am a stata user since 5 years. You are right I was trying to mimic the same stata code/function in R.

However, your answer is clear and helpful!

Best regards,
Al