In this paper, we describe a graphene p-n junction created by chemical doping. We find that chemical doping does not reduce mobility in contrast to top-gating. The preparation technique has been developed from systematic studies about influences on the initial doping of freshly prepared graphene. We investigated the removal of adsorbates by vacuum treatment, annealing, and compensation doping using NH(3). Hysteretic behavior is observed in the electric field effect due to dipolar adsorbates like water and NH(3). Finally we demonstrate spatially selective doping of graphene using patterned PMMA. Four-terminal transport measurements of the p-n devices reveal edge channel mixing in the quantum hall regime. Quantized resistances of h/e(2), h/3e(2) and h/15e(2) can be observed as expected from theory.