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 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.
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.