polynomial curve fitting in r