On Eisenbud's and Wigner's R-matrix: A general approach