R scripts for stats and visualization