How the effects(Q'*y) in lm.fit calculated? In R, lm.fit return an effects variable which equals to Q'Y or Rb (X=Q*R). However, I am confused by the dimension of this variable. In my case, dim(X)=6*2, dim(Q)=6*2, dim(R)=2*2, dim(Y)=6*10, so the dim(Q'*Y) should be 2*10, whereas lm.fit gave a 6*10 matrix. The first two rows of effects are identical to Q'*Y, but I have no idea how the remaining rows were calculated.
 A: This is covered in Section 4.4.1 in the White Book (Statistical Models in S, Chambers & Hastie (eds), 1991; CH henceforth). But basically, you are confusing the matrix $\mathbf{Q}$ with its submatrix $\mathbf{Q}_1$ following the notation in CH.

To elaborate, $\mathbf{Q}$ is the orthonormal $N \times N$ matrix such that $\mathbf{Q}'.\mathbf{Q} = \boldsymbol{\iota}$, where $\boldsymbol{\iota}$ is the identity matrix. It is chosen so that 
$$
\mathbf{Q}'.\mathbf{X} = \begin{bmatrix}\mathbf{R} \\ \mathbf{O}\end{bmatrix}
$$
where, $\mathbf{R}$ is an upper triangular matrix.
All the relations you state, are only true of the submatrix $\mathbf{Q}_1$ of $\mathbf{Q}$ 
$$
\mathbf{X} = \mathbf{Q}_1.\mathbf{R}
$$
where the columns of $\mathbf{Q}_1$ span the columns of $\mathbf{X}$. This means that $\mathbf{Q}_1$ is an $N \times K$ submatrix of $\mathbf{Q}$ ($K$ is the total number of regressors).
Next, on page 133, CH clearly define effects (vector $\boldsymbol{C}$ below), and also point out the elements that correspond to $\mathbf{Q}_1$:
$$
\begin{align}
\boldsymbol{C} &= \begin{bmatrix}\boldsymbol{C}_1 \\ \boldsymbol{C}_2 \end{bmatrix} \\
&= \mathbf{Q}'\boldsymbol{Y}
\end{align}
$$
where $\boldsymbol{C}_1$ is of length $K$, and $\boldsymbol{C}_2$ is of length $N-K$. These are what you get as named elements of lm.fit.obj$effects.
And, as you have rightly figured out, the least squares solution, $\widehat{\boldsymbol{\beta}}$ is any vector that solves:
$$
\mathbf{R}\widehat{\boldsymbol{\beta}} = \boldsymbol{C}_1 = \mathbf{Q}'_1\boldsymbol{Y} 
$$

Here is an example:
# generate some data
set.seed(1)
mX = matrix(rnorm(6*2), nrow = 6, ncol = 2)
vBeta = rnorm(2)
vY = rnorm(6, mX %*% vBeta)

# fit the model
lmA = lm.fit(x = mX, y = vY)

# Q1'.Y = C1
t(qr.Q(lmA$qr)) %*% vY

# full effects vector
lmA$effects

