R script for GL time series data analysis