Some R scripts