Cosmological distance calculator in R