I want to sort the correlation between the residual of a time series regression and several prospective X independent variables : And, I want the correlations to be ranked by absolute correlation.  And, I also want the output show the name of each X variable with its absolute correlation and its actual correlation (showing the sign).  

Using the following codes I was able to calculate the correlation between the residuals (object res1) and the X variables (located within the data2 dataframe). 

    cor(data2, res1, method = c("pearson"))

The above code generated the output below that shows vertically in the console.

         [,1]
x1 0.45683210
x2 0.62858863
x3 0.08457911
x4 0.41022052

Next, using the following code I was able to rank those correlations by their absolute value using the sort() function.

    abs(cor(data2, res1, method = c("pearson")))
    abs1<-abs(cor(data2, res1, method = c("pearson")))
    sort(abs1, decreasing = TRUE)

And, I got the following output. 

[1] 0.62858863 0.45683210 0.41022052 0.08457911 

I want to generate an output that looks like a table or a dataframe.  In the first column you would have the labels of the X variable, in the second column you would have their absolute correlation, and in the third column you would have the actual correlation with their sign.  And, this vertical tabular list would be ranked in descending order.  I think I have all the info I need.  I just need the codes to generate the output as specified.  

