Does Boruta feature selection (in R) take into account the correlation between variables? I am a bit of a novice in R and feature selection, and have tried the Boruta package to select (diminish) my number of variables (n= 40). I thought that this method also took into account the possible correlation between variables, however, two (of the 20 variables selected) are highly correlated, and two others are completely correlated. Is this normal? Shouldn't the Boruta method have classified one of the two as unimportant? 
 A: It lies in the nature of the algorithm. Let us assume that we have two meaningful features $X_1$ and $X_2$ that are strongly correlated.
From the paper http://arxiv.org/abs/1106.5112 (The All Relevant Feature Selection using Random Forest, Miron B. Kursa, Witold R. Rudnicki) we can take a short description of the boruta algorithm:

"To deal with this problem, we developed an algorithm which provides criteria for selection of important attributes. The algorithm arises from the spirit of random forest – we cope with problems by adding
  more randomness to the system. The essential idea is very simple: we make a randomised copy of the
  system, merge the copy with the original and build the classifier for this extended system. To asses importance of the variable in the original system we compare it with that of the randomised variables. Only
  variables for whose importance is higher than that of the randomised variables are considered important."

Essentially the Boruta algorithm trains a random forest on the set of original and randomized features. This random forest during training, as every random forest, only sees a subset of all features at every node. Hence sometimes it will not have a choice between $X_1$ and $X_2$ when picking the variable for the current node and it cannot prefer one of the two variables $X_1$ and $X_2$ over the other. 
This is is the reason why Boruta can not classify one of the variables $X_1$ and $X_2$ as unimportant.
One would have to modify the underlying random forest algorithm to always see $X_1$ and $X_2$ with their random shadow variables $\hat X_1$ and $\hat X_2$ at every node. Then the random forest could often for example select the variables $X_1$ and $\hat X_2$ which would result in Boruta selecting variable $X_1$ and rejecting $X_2$. (Here $X_2$ is rejected because $\hat X_2$ has a higher importance than $X_2$)
A: Yes it is normal. Boruta algorithm throws out attributes that have no value to the classifier, leaving the 'all-relevant' set of attributes, which may well include correlated ones. Contrast that to the 'minimal-optimal' set (which should not contain correlated).
So why then, should one use this method for feature selection? You may find this quote from the original paper useful:

Finding all relevant attributes, instead of only the non-redundant ones, may be very useful in itself. In particular, this is necessary when one is interested in understanding mechanisms related to the subject of interest, instead of merely building a black box predictive model.
For example, when dealing with results of gene expression measurements in context of cancer, identification of all genes which are related to  cancer is necessary for complete understanding of the process, whereas a minimal-optimal set of genes might be more useful as genetic markers.

So if your primary goal is to understand causal links between the predictors and the outcomes, considering only the optimal set of variables may lead you astray and you need study the all-relevant set.
However, if what you are seeking is an efficient model to fit, you are better off using the minimal-optimal set.
A: 
... , two (of the 20 variables selected) are highly correlated, and two
  others are completely correlated. Is this normal? Shouldn't the Boruta
  method have classified one of the two as unimportant?

Yes it is normal. Boruta tends to find all features relevant to the response variable $y$. Rigorously speaking, a predictor variable $x_i$ is said to be relevant to $y$ if $x_i$ and $y$ are not conditionally independent given some other predictor variables (or given nothing, which would simply mean that $x_i$ and $y$ are not independent).
Consider this simple example :
set.seed(666)
n <- 100
x1 <- rnorm(n)
x2 <- x1 + rnorm(n,sd=0.5)
x3 <- rnorm(n)
y <- x2 + rnorm(n) 

You see that $y=x_2+\text{noise}$, then $x_2$ is relevant to $y$, because $y$ and $x_2$ are not independent. You also see that $x_2=x_1+\text{noise}$ and then $y$ is not independent of $x_2$. The only variable not relevant to $y$ is $x_3$, because:


*

*$y$ and $x_3$ are independent

*$y$ and $x_3$ are conditionally independent given $x_1$

*$y$ and $x_3$ are conditionnaly independent given $(x_1,x_2)$


Then Boruta finds the expected result:
> library(Boruta)
> Boruta(data.frame(x1,x2,x3), y)
Boruta performed 30 iterations in 2.395286 secs.
 2 attributes confirmed important: x1, x2.
 1 attributes confirmed unimportant: x3.

There is a high correlation between $x_1$ and $x_2$, but Boruta does not mind about that:
> cor(x1,x2)
[1] 0.896883

