I have now been trying different solutions and ways for a long time. Could somebody please help me understand how i could implement this sum calculation in R?
I also want save the result of that calculation to a vector called sumOne
.
CodePudding user response:
i <- 10:109
sum(i^3 4*i^2)
[1] 37687400
CodePudding user response:
We can use vectorized option in R
sum(v1^3 4 * v1^2)
[1] 37687400
data
v1 <- 10:109