I have a huge dataframe 5600 X 6592 and I want to remove any variables that are correlated to each other more than 0.99 I do know how to do this the long way, step by step i.e.
@David A small change in your code make it more robust to negative correlation , by providing
abs(x) > 0.99
instead of only
x > 0.99
data.new <- data[,!apply(tmp,2,function(x) any(abs(x) > 0.99))]
cheers..!!!