Baker performed the role of R2-D2 inside a standing unit of the droid, wearing a specially-made suit and manipulating the droid's lights and appendages, turning his head, rocking his body back and forth, and moving his eye with a rod. In addition to Baker's unit, every Star Wars film has made use of a number of remote control units, as Baker's was largely immobile.
[...]
A computer-generated R2-D2 was also used in many scenes of the prequel trilogy, including a scene in Episode II where the character walks up a staircase. Baker has stated that he would never have been able to do that in his costume.