[1] 5 5 5 5
[1] "1" "2" "3" "4"
EDS 221 Day 4 PM
Vectorized functions
August 13th, 2025
Vectorization
Vectorized functions and operators work on entire vectors at once, rather than element by element.
Using vectorization often improves code performance and clarity.
Functions and operators
Both functions and operators can be vectorized.
Review
The round() function rounds numbers.
Consider this expression:
Using only pencil and paper, answer the following questions.
Tip
Solve sub-expressions first to build up to the complete solution.
round() vectorized over?