added example to R doc