How does R handle mathematical operations on vectors?

  • R applies the operation element-wise
  • R applies the operation to the first element only
  • R applies the operation to the last element only
  • R does not allow mathematical operations on vectors
R applies mathematical operations on vectors element-wise. For example, if we have two vectors a and b, the operation a + b would result in a new vector where each element is the sum of the corresponding elements in a and b.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *