Text this: Modern statistical methods for Astronomy with R applications