Hi there! I'm quite new with R, so this question might seem a bit dumb.
I have the following data frame, where i have at the start some text that would be the name of the variable and then five numbers separated by spaces, than represent different moments of time.
metric1
1 Total Revenue 112 110 108 100 94
2 Total Revenue 534 523 514 500 485
3 Cost of Revenue 73 72 71 66 62
4 Cost of Revenue 403 394 385 373 361
5 Gross Profit 38 37 37 34 32
6 Gross Profit 131 129 129 126 124
There is any way i can split the column first betweeen text and numbers, and then by number in order to have something like this?
Metric | Year1 | Year2 | Year3 | Year4 | Year5 |
---|---|---|---|---|---|
Total Revenue | 112 | 110 | 108 | 100 | 94 |
Total Revenue | 534 | 523 | 514 | 500 | 485 |
Cost of Revenue | 73 | 72 | 71 | 66 | 62 |
Cost of Revenue | 403 | 394 | 385 | 373 | 361 |
Gross Profit | 38 | 37 | 37 | 34 | 32 |
Gross Profit | 131 | 129 | 129 | 126 | 124 |
Thank you for your time!