I have the dataframes Relaxed.swimming,Intense.swimming,Resting and Burst. They share the number of columns (4 columns) but they differ in the number of rows. As an example:
Relaxed.swimming <- data.frame(Behaviour= "Relaxed.swimming",
disurge=c(0.015,0.908,0.345,0.489),
diheave=c(0.398,0.782,0.198,0.634),
disway=c(0.491,0.398,0.189,0.592))
Intense.swimming <- data.frame(Behaviour= "Intense.swimming",
disurge=c(0.015,0.908,0.345),
diheave=c(0.398,0.782,0.198),
disway=c(0.491,0.398,0.189))
Burst <- data.frame(Behaviour= "Burst",
disurge=c(0.015,0.908),
diheave=c(0.398,0.782),
disway=c(0.491,0.398))
Resting <- data.frame(Behaviour= "Resting",
disurge=c(0.015,0.908,0.345),
diheave=c(0.398,0.782,0.198),
disway=c(0.491,0.398,0.189))
I just want to combine them by rows (keeping the 4 columns). The point is that I want to combine them hundreds or thousands of times and I want to combine them randomly, that is, the order changes constantly (i.e. rbind(Relaxed.swimming, Intense.swimming, Resting, Burst, Resting, Intense.swimming, Relaxed.swimming, Resting, etc)). Although I want to combine them randomly, I want to keep proportions (the four vectors are replicate approximately the same number of times). The ratios don't have to be exactly 1:1:1:1 but they should be close.
I would like to get something like that:
> df
Behaviour disurge diheave disway
1 Resting 0.015 0.398 0.491
2 Resting 0.908 0.782 0.398
3 Resting 0.345 0.198 0.189
4 Burst 0.015 0.398 0.491
5 Burst 0.908 0.782 0.398
6 Intense.swimming 0.015 0.398 0.491
7 Intense.swimming 0.908 0.782 0.398
8 Intense.swimming 0.345 0.198 0.189
9 Relaxed.swimming 0.015 0.398 0.491
10 Relaxed.swimming 0.908 0.782 0.398
11 Relaxed.swimming 0.345 0.198 0.189
12 Relaxed.swimming 0.489 0.634 0.592
13 Burst 0.015 0.398 0.491
14 Burst 0.908 0.782 0.398
15 Relaxed.swimming 0.015 0.398 0.491
16 Relaxed.swimming 0.908 0.782 0.398
17 Relaxed.swimming 0.345 0.198 0.189
18 Relaxed.swimming 0.489 0.634 0.592
. . . . .
. . . . .
. . . . .
How can I get a large data frame obtained from the random replication of the 4 mentioned dataframes?
Does anyone know how to do it?
Thanks in advance