[R] sampling vectors

Eric Pante ericpante at earthlink.net
Mon Oct 3 23:31:01 CEST 2005


Hello Listers,

I am trying to sample a vector to create a new one of sample length, 
witha  sum equal to the sum of the initial vector:

initial = 10, 30, 10 (sum=50)
sample example = 5, 35, 10 (sum=50) or 25, 15, 10  (sum=50), etc ...

My problem is to control the sum, so it stays constant.
Any suggestions would be very helpful !

Thank you in advance,
Eric




More information about the R-help mailing list