  The Lagrange-mesh $R$-matrix method is generalized to inhomogeneous
equations. This method is numerically stable and efficient. It can be directly
used for transfer reactions with the formalism discussed by Ascuitto and
Glendenning [Phys. Rev. 181,1396 (1969)] and for inclusive breakup reactions
modeled by Ichimura, Austern, and Vincent [Phys. Rev. C 32, 431 (1985)]. We
first present a simple example to assess the method. Then the application to
the $^{93}$Nb($d$,$pX$) non-elastic breakup is discussed.
