I am trying to randomly sample 7 numbers from 0 to 7 (with replacement), but subject to the constraint that the numbers chosen add up to 7. 144 more words

## Tags » Kirk Fogg

#### R: sample() command subject to a constraint

I am trying to randomly sample 7 numbers from 0 to 7 (with replacement), but subject to the constraint that the numbers chosen add up to 7. 144 more words

#### R: Number of a specific entry in a matrix row

I have a matrix where the entries are the numbers 0, 1, 2, or 3. I am trying to determine the number of rows in this matrix that contain the number “3” two times. 73 more words