Basic astronomical calculations with R