In R, I have a very long dataframe in which there are two columns as follows:
| up | low |
|---|---|
| 5 | 10 |
| 10 | 20 |
| 20 | 30 |
| NA | NA |
| NA | NA |
| NA | NA |
| NA | NA |
| NA | Na |
| NA | NA |
I would like to repeat the sequence of numbers in these two columns until the end of the dataframe. So, my desired table should look like this:
| up | low |
|---|---|
| 5 | 10 |
| 10 | 20 |
| 20 | 30 |
| 5 | 10 |
| 10 | 20 |
| 20 | 30 |
| 5 | 10 |
| 10 | 20 |
| 20 | 30 |
How can I do it in R? What codes can be used to do this? Please help me. Thanks