Displaying 1 result from an estimated 1 matches for "997x997".
Did you mean:
997997
2009 Jul 10
2
while( ) to get a vector until the sum of elements are <= X ?
I have a vector of values
X = seq(1:10)
I want to get another vector V of with sample (with replacement) of X but
with a constrain: V will have as much elements as those necessary to V sum
exactly 10.
If the N-th value of V make the sum greater than 10, it's is subtracted with
the difference to achieve the constrain.
I don't know how to achieve this. with a while?