generate data using r