Add R script for factor analysis