R Code for Differential Smoothing