title: How to compute correlations between all columns in R and detect highly correlated variables
body: <p>I have a big dataset with 100 variables and 3000 observations.
  I want to detect those variables (columns) which are highly correlated or redundant and so remove the dimensonality in the dataframe. 
  I tried this but it calculates only the correlation between one column and the others; and I always get an error message </p>
  
  <pre><code>for(i in 1:ncol(predicteurs)){
  correlations &lt;- cor(predicteurs[,i],predicteurs[,2])
  names(correlations[which.max(abs(correlations))])
  }
  
    Warning messages:
   1: In cor(predicteurs[, i], predicteurs[, 2]) :
  the standard deviation is zero
    2: In cor(predicteurs[, i], predicteurs[, 2]) :
   the standard deviation is zero
  </code></pre>
  
  <p>Can anyone help me?</p>