Reputation: 1
Sorry for the super basic question, am new here and to coding:
For example I have a vector: v <- c(12, 26, 77, 54)
and I want to multiply each element by 100 so the output will be c(1200, 2600, 7700, 5400)
.
How would I go about this?
Have tried using 'prod' function and "*"
Upvotes: 0
Views: 236
Reputation: 78907
Just multiply the whole vector by 100:
v <- c(12, 26, 77, 54) * 100
v
[1] 1200 2600 7700 5400
Upvotes: 2