[R] some questions

yuying shi leavestonebodt at yahoo.com
Thu Nov 17 04:55:05 CET 2005


Dear R expert,
 The following is my questions:

1. How to generate two sequences of 150 uniform
deviates, called v1 and v2, in the range [-1,1]. 
2. How to compute  r=(v1)^2+(v2)^2
3.If r is outside the range of (0,1) then it will be
discarded. 
4 How to compute (v1)*sqrt(-2*log(r)/r) and output the
first 100 z values in the list. 
5. Plot histograms for the sequences from steps 1 and
2. 

Thanks very much for your help!

xingyu




More information about the R-help mailing list