R Code for Kepler Stuff