Here's another option
As stated above, a simple resistor is not the best way of doing it
The circuit is very simple, and a nice introduction to building electronics, but it does need some designing. So I thought I'd show you what you need to do. It's worth noting at the outset that a 7805 by itself will only supply 1 amp, but that is enough for a RaspPi.
You will also need a heat sink of several square inches, a full-wave rectifier rated for well over 1 amp at over 18 volts, a large capacitor, and a 0.1 microfarad capacitor to stabilise the 7805.
There are three calculations you need to do:
First a 12V transformer is 12V RMS, not peak-to-peak, so your transformer will output 12 x sqroot(2) = 17V peak to peak. When you put that through the full-wave rectifier it will drop by maybe 0.7V, but it's still high.
Then the capacitor has to supply current while the full-wave rectified signal is too low for the regulator, so assuming the power is delivered only at the peak of the waveform at 10ms intervals, 1A for 0.01s = 0.01 Coulombs, Q=CV, C = Q/V
The 7805 requires that the input voltage stays above 7.5V, So the maximum voltage drop you can live with is 8V. So C = 0.01/8 = 1,250 microfarads. And when you buy that monster, remember your voltage is the best part of 20V.
Then you will want a large enough heatsink to dissipate 17-5=12volts at 1 amp = 12 watts. If you want it to only get to about 40 Celsius, you're looking for 20 Celsius/12watts = 1.6 C/watt. Like this one.
Here's the circuit diagram.