Transparent conductive oxides have attracted extensive attentions as a promising candidate for next-generation display materials. As a substitute for indium tin oxide, BaSnO3-based materials have been widely investigated with the improvement of electrical resistivity and optical transparency. Here, the effects of diverse rare-earth ions (R = La, Nd, Sm, Er) doping on the structural, electrical, and optical properties of RxBa1−xSnO3 films are systematically studied. The rare-earth ion doping improves the crystallinity of epitaxial RxBa1−xSnO3 films. And a rule for electrical performance optimization is revealed that the resistivity and metal-semiconductor transition temperature increase with increased atomic number of rare-earth ions. Further optimized composition for LaxBa1−xSnO3 is realized at x = 5% with the minimum resistivity of 0.31 mΩ cm. Moreover, all RxBa1−xSnO3 films exhibit a high transparency of greater than 90% in the visible region. This work demonstrates that among these four rare-earth ion doping, La-doping is the most effective approach to optimize the comprehensive properties of BaSnO3-based transparent conductive films.