Augmented Dickey-Fuller test and Differencing (R) I'm using the ADF test to check for stationarity of two variables, using the ndiffs function in R.
> ndiffs(x[, "Apples"], alpha = 0.05, test = c("adf"))
[1] 2
> ndiffs(x[, "Romulans"], alpha = 0.05, test = c("adf"))
[1] 0

Next step is as far as I understand to difference the time series with the appropriate lag to achieve stationarity, but this is when I encounter difficulty.
Using:
d.x1 = diff(x[, "Apples"], lag = 2)
d.x2 = diff(x[, "Romulans"], lag = 0)

doesn't work as the lag and difference must be an integer >= 1. 
and excluding the lag option for the Romulans variable gives a warning message as soon as I try dx = cbind(d.x1, d.x2) saying that the number of rows result is not a mulitple of vector length (arg 1).
Should I use lag 2 for both variables? What is the best way to handle a situation like this?
 A: 
Next step is as far as I understand to difference the time series with the appropriate lag

Actually, not with the appropriate lag but an appropriate number of times.
ndiffs indicates the argument variable's order of integration. Say, it is $n$. To make the variable stationary, you are supposed to difference $n$ times. This is not the same as to difference using $\text{lag}=n$. Here are some examples:
Difference once with $\text{lag}=1$: diff(x,lag=1,differences=1) yields $\Delta x_t:=x_t-x_{t-1}$.
Difference twice with $\text{lag}=1$: diff(x,lag=1,differences=2) yields $\Delta^2 x_t:=\Delta x_t-\Delta x_{t-1}=(x_t-x_{t-1})-(x_{t-1}-x_{t-2})=x_t-2x_{t-1}+x_{t-2}$.
Difference once with $\text{lag}=2$: diff(x,lag=2,differences=1) yields $\Delta x_t:=x_t-x_{t-1}$.  
The last example is not what ndiffs is about, while the first and the middle one are fine.
Also, if $n=0$, you do not have to difference and you just leave the variable as is.

excluding the lag option...

When you do not specify the lag argument explicitly, is assumes its default value which is 1; it does not just disappear.

number of rows result is not a mulitple of vector length (arg 1)

Differencing a variable $n$ times results in it being shortened by $n$ observations. To match a differenced variable that was originally of length $n$ with a non-differenced variable that is of length $n$ you will have to cut the initial $n$ values of the non-differenced variable: x[-c(1:n)]. Then the two variables will match correctly.
