R script for some literature thesis