It also depends on which nonparametric regression you gonna use. GAM or regression splines or others
The book of Generalized Additive Models An introduction with R provides the step by step R codes for those methods as well as examples using function from some libraries. It would be helpful to have a look.