Update fun.R

code change proposal
should psp be declared inside function? 
@michbur: not necesselary, just move it out
@michbur: exchange spline by savgol? Benefit is questionable (equidistant problems ...).