I currently have the following dataframes:
> corr
i4 i3 i2
i1 0.7965509 0.8198761 0.7941727
> newcor
i4 i3 i2
i1 0 0 0
I would like to combine these dataframes into one dataframe that sorts the corr values from greatest to least from left to right and puts the corresponding newcor values in the following row so that the final result is:
> newcor
i3 i4 i2
i1 0.8198761 0.7965509 0.7941727
i1 0.0000000 0.0000000 0.0000000
It is just a coincidence that all the values in the 2nd row are 0s, and they must lineup according to initial values in newcor. For example in this case the first newcor would be:
> newcor
i3 i4 i2
i1 0 0 0