  We apply the $R$-matrix method in Distorted Wave Born Approximation (DWBA)
calculations. The internal wave functions are expanded over a Lagrange mesh,
which provides an efficient and fast technique to compute matrix elements. We
first present an outline of the theory, by emphasizing the $R$-matrix aspects.
The model is applied to the 16O(d,p)7Li and 12C(7Li,t)16O reactions, typical of
nucleon and of $\alpha$ transfer, respectively. We illustrate the sensitivity
of the cross sections with respect to the $R$-matrix parameters, and show that
an excellent convergence can be achieved with relatively small bases. We also
discuss the effects of the remnant term in DWBA calculations, and address the
question of the peripherality in transfer reactions. We suggest that
uncertainties on spectroscopic factors could be underestimated in the
literature.
