Explaining the R script sun_analysis