For a stat. analysis in R I need to modify my raw table with a numeric column “SumBirds” = 4, 7, 12, 20, etc (table1) to a new table2 , where each segment of a column “bird” has so “1” (one bird) and all others lines of the raw table are duplicated as many times, as value has parameter “SumBird”.
How can I do it in R or in EXCEL (where I prepare my data)?
Examples: Table1 (raw table)
Sumbird Temp OutHum
4 28.7 69
6 22.3 58
Table 2 (modificated table)
bird Temp OutHum
1 28.7 69
1 28.7 69
1 28.7 69
1 28.7 69
1 22.3 58
1 22.3 58
1 22.3 58
1 22.3 58
1 22.3 58
1 22.3 58