R LanguageR code vectorization best practices