expanded factor.R examples