This document introduces vectorized operations in R. It explains that many R operations can be performed on entire vectors or matrices at once, making code more efficient and readable. Examples are provided of common vectorized arithmetic, logical comparison, and matrix operations like addition, multiplication, and division that can be performed element-wise or through true matrix multiplication on entire vectors and matrices at once.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
81 views3 pages
Vectorized PDF
This document introduces vectorized operations in R. It explains that many R operations can be performed on entire vectors or matrices at once, making code more efficient and readable. Examples are provided of common vectorized arithmetic, logical comparison, and matrix operations like addition, multiplication, and division that can be performed element-wise or through true matrix multiplication on entire vectors and matrices at once.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3
Introduction to the R Language
Vectorized Operations
Roger Peng, Associate Professor
Johns Hopkins Bloomberg School of Public Health
Vectorized Operations Many operations in R are vectorized making code more efficient, concise, and easier to read. > x > x [1] > x [1] > x [1] > y [1] > x [1] > x [1]