Create Factor_functions.r

Various methods for factor generation