0

I would like to create a virtual patient data set in R , where in I would like to have the following time points TIME = seq(1, 10, 1), be repeated for 3 unique patient IDs enter image description here

abc
  • 27
  • 5

1 Answers1

0

Thanks to the comment from @markus, you can use expand.grid:

df <- expand.grid(TIME = 1:10, ID = 1:3)
Bjørn Kallerud
  • 979
  • 8
  • 23