'Simulate a data frame with different sequence per column [closed]
I would like to simulate in R a data frame with 4 columns with the above conditions:
Each row is summing up to 1
The first element of column 1 starts with being closer to 1, say 0.9, but gradually decreases per row.
The elements of the other 3 columns start low, say something between 0.02 - 0.05, but gradually increase with each row.
I would like the last row of the data frame being c(0.25, 0.25, 0.25, 0.25).
Can you help me with creating something like that ? Thank you in advance!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
