In R, you can perform arithmetic operations on vectors element-wise. The operations will be applied to each corresponding element of the vectors.
Example code:
# Vector addition
vector1 <- c(1, 2, 3)
vector2 <- c(4, 5, 6)
result <- vector1 + vector2 # Element-wise addition
# Vector multiplication
vector3 <- c(2, 3, 4)
vector4 <- c(5, 6, 7)
result <- vector3 * vector4 # Element-wise multiplication