The resistor is only there for safety, the current flowing through it is very small compared to the current through the capacitor. If you omitted it, there would be a risk that when switched off a high voltage might appear across the AC connections and be dangerous to anyone touching them. The resistor ensures it leaks away within a few seconds.
The capacitor works like a resistor except it dissipates very little heat, the equivalent value is 1 / (2 * pi * f * C) where f is in Hz and C is in Farads, the result is in Ohms. One of the problems with these lights is that they work differently in 50Hz and 60Hz countries ('f' is different in the calculation). They should have a fuse in series with the AC input as well in case the capacitors or diodes fail as short circuits.
Brian.