2

I want to split the value into chunks but having a different values. For example, I have an integer of 300 and want to split it into 95 105 100.

The summation of three chunked values is 300.

I found that split(example.data, rep(1:4, c(4,2,1,3))) gives me the similar way what I am looking for, but I want to have split size randomly generated whenever I split.(meaning that I don't want to specify the split numbers.)

How to achieve this issue in R?

sclee1
  • 1,095
  • 1
  • 15
  • 36
  • 1
    You might find an idea here: [Generate 3 random number that sum to 1 in R](https://stackoverflow.com/questions/11003967/generate-3-random-number-that-sum-to-1-in-r) – LAP Aug 02 '17 at 11:38

0 Answers0