The Radius–Luminosity Relationship Depends on Optical Spectra in Active Galactic Nuclei