The aim of this work is to shed some light on the problem of the formation of carbon stars of R-type from a detailed study of their chemical composition. We use high-resolution and high signal-to-noise optical spectra of 23 R-type stars selected from the Hipparcos catalogue. The chemical analysis is made using spectral synthesis in LTE and state-of-the-art carbon-rich spherical model atmospheres. We derive their CNO content (including the carbon isotopic ratio), average metallicity, lithium, and light (Sr, Y, Zr) and heavy (Ba, La, Nd, Sm) s-element abundances. The observed properties of the stars (galactic distribution, kinematics, binarity, photometry and luminosity) are also discussed. Our analysis shows that late-R stars are carbon stars with identical chemical and observational characteristics than the normal (N-type) AGB carbon stars. We confirm the results of the sole previous abundance analysis of early-R stars by Dominy (1984, ApJS, 55, 27), namely: they are carbon stars with near solar metallicity showing enhanced nitrogen, low carbon isotopic ratios and no s-element enhancements. In addition, we have found that early-R stars have Li abundances larger than expected for post RGB tip giants. We also find that a significant number (aprox. 40 %) of the early-R stars in our sample are wrongly classified, being probably classical CH stars and normal K giants. In consequence, we suggest that the number of true R stars is considerably lower than previously believed. We briefly discuss the different scenarios proposed for the formation of early-R stars. The mixing of carbon during an anomalous He-flash is favoured, although no physical mechanism able to trigger that mixing has been found yet. The origin of these stars still remains a mystery.