I was able to create a table long-form by binding the rows of two different data frames generated (one for species 1 fraction and the second for species 2), but I can't seem to bring along a column that details which CropSp each row's LER fraction is referring to within the for loop. I have tried everything I can think of or search on forums.
Can I somehow create a vector of the correct order of species and join it outside of the for loop? I'm not sure how to get the correct order before joining it. Or can I somehow use the [i] in the for loop?
It starts on line 141 of the R file titled 'harvestAGonly.R' now (finally) up on GitHub.
I was able to create a table long-form by binding the rows of two different data frames generated (one for species 1 fraction and the second for species 2), but I can't seem to bring along a column that details which CropSp each row's LER fraction is referring to within the for loop. I have tried everything I can think of or search on forums.
Can I somehow create a vector of the correct order of species and join it outside of the for loop? I'm not sure how to get the correct order before joining it. Or can I somehow use the [i] in the for loop?
It starts on line 141 of the R file titled 'harvestAGonly.R' now (finally) up on GitHub.