This presentation gives a brief review of the work on the R2Cu2O5 (R=Tb-Lu, Y, Sc, In) and R2BaMO5 (R=Nd, Sm-Gd, Dy-Lu and Y, M=Cu, Ni) cuprates and nickelates, performed by the author's group. We measured high-resolution optical absorption spectra of an intrinsic R3+ ion or Er3+ probe in these compounds, by means of a Fourier transform spectrometer. On the basis of these spectra, we investigated crystal field splittings of the rare-earth energy levels, magnetic ordering, low-dimensional magnetic correlations, the arrangement of magnetic moments of transition metal ions and peculiarities of spin-reorientation phase transitions. We have registered for the first time, magnetic phase transitions, some of them not detectable by other methods, in R2BaCuO5 with R=Nd, Dy, Yb, Lu, Y and in R2BaNiO5 with R=Nd, Sm, Gd, Eu, Dy, Ho, Tm, Lu. (C) 1998 Elsevier Science S.A.