Im have the count occurs data frame about other data frame. In Freq I show the times of this ACESION appear.
ACCESION Freq
G 838 2
G 938 3
The other data frame is this:
DT <- structure(list(ACCESION = c("G 838", "G 938"),
GENERO = c("Phaseolus", "Phaseolus"),
ESPECIE = c("vulgaris", "vulgaris"),
LATITUD = c(19.43, 16.75),
LONGITUD = c(-98.17, -96.74), ALTURA = c(2660, 1800)), row.names = 1:2, class = "data.frame")
####################################################
ACCESION GENERO ESPECIE LATITUD LONGITUD ALTURA
G 838 Phaseolus vulgaris 19.43 -98.17 2660
G 938 Phaseolus vulgaris 16.75 -96.74 1800
In order of Freq, I need put this copies in each correspond ACCESION in DT. Like this:
For example, like Freq is 2 for G 838, I need repeat 2 time this whole row. For G 938 are 3 times.
ACCESION GENERO ESPECIE LATITUD LONGITUD ALTURA
G 838 Phaseolus vulgaris 19.43 -98.17 2660
G 838 Phaseolus vulgaris 19.43 -98.17 2660
G 938 Phaseolus vulgaris 16.75 -96.74 1800
G 938 Phaseolus vulgaris 16.75 -96.74 1800
G 938 Phaseolus vulgaris 16.75 -96.74 1800
Because make this one by one is very time consuming. I have 3000 rows.