The effect of oxygen adsorption on a nanotube-based field effect transistor have been controversial as to whether it induces p-type doping of the nanotube body or the work function increase in the metal electrode. Here we report a transport measurement showing that a long individual single-walled nanotube can be doped as p-type upon oxygen adsorption. We discuss that, despite the fact that the charge transfer between the nanotube and O2 adsorbator has not been agreed to date, the effect of oxygen adsorption should still be interpreted as inducing p-type doping in the nanotube body. The n-type doping by NH3 adsorption is also measured for the purpose of comparison. Based on these observations, we suggest that, while the Schottky barrier management could be more effective for the transistor with a short nanotube, the doping effect could be more influential in devices with longer nanotubes.