The diode only passes the positive half of the waveform to the load, represented by the resistor. The load voltage is the positive half minus the diode forward voltage drop, VF. Closing the switch includes a "bulk decoupling capacitor", which acts as a charge gas tank: It fills up when the source voltage is high, and provides current to the load when the source voltage is lower. This smooths the rectified voltage. Try increasing the capacitance to see the effect.