I was wondering if astromech droids (like R2-D2) could fully control any unmanned ship they're mounted in.
We see R2 pilot Mace Windu's Jedi Starfighter in "R2 Come Home", an episode of The Clone Wars
Not only does he do some pretty fancy flying (surviving a dogfight with Slave I), he docks with a hyperspace ring and flies all the way to Coruscant.
He also flies a Y-Wing bomber in "Nomad Droids", a later episode, and even blows up some vulture droids:
In Revenge of the Sith we see Obi-Wan's R7 unit take his Starfighter back to the Republic ship with a message for Commander Cody, tricking General Grievous into thinking he has left Utapau so he can surprise the Separatist forces.
In Revenge of the Sith Obi-Wan has his droid take control of the flying for a bit.
OBI-WAN: All right, R4. No, no. Nothing too fancy.
and later he even says
OBI-WAN: Flying is for droids!
He has his droid fly the ship again on Utapau.
OBI-WAN: Take the Fighter back to the ship
In Empire Strikes Back R2 also makes a suggestion about taking control of the ship.
LUKE: (into comlink) Yes, R2?
R2 utters a soft, carefully phrased steam of whistles.
LUKE: (into comlink, chuckling) That's all right. I'd like to keep it on manual control for a while.
The little droid lets out a defeated whimper. Luke smiles, and continues on his course.
- Ep. V script
So yes, droids can fly the ships they're mounted in, even without a pilot inside the cockpit.
Also answered by this scifi exchange post.
R2D2 could control Luke's X-Wing in Episode V.
The answer is yes. There are a few examples for this. One is an episode in The Clone Wars where R2-D2 even outmanoeuvred the slave one. Another is in the films in The Empire Strikes Back. There R2-D2 during the evacuation scene flies the X-Wing towards the landing zone and Luke.
During Empire Strikes Back, after leaving Hoth:
R2, set a course for the Dagobah system
Also, a droid can handle more G-Forces than a human, so outmaneuvering a bounty hunter was no big deal for him.
In the new (canon) novelisation of Star Wars: The Empire Strikes back, we have the following passage, just after the Battle at Hoth.
A short distance farther sits your X-wing, a spaceship outfitted for one pilot and one droid. R2 is in his place. He’s the one who piloted it out here to the muster site, to wait for you.
In addition to the above examples of droids piloting starfighters, droids are also capable of piloting capital ships. There are many examples of Separatist capital ships being piloted by droids in The Clone Wars, not to mention the scene at the beginning of Revenge of the Sith.
Further, some droids are starfighters, again, at the beginning of Revenge of the Sith. Obviously, a droid that functions as a starfighter is capable of piloting itself, and is therefore capable of piloting a starfighter.