acepen
acepen

Reputation: 21

how do i implement this algebraic sum in R?

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.

enter image description here

Upvotes: 1

Views: 198

Answers (2)

akrun
akrun

Reputation: 887108

We can use vectorized option in R

sum(v1^3 + 4 * v1^2)
[1] 37687400

data

 v1 <- 10:109

Upvotes: 2

Vin&#237;cius F&#233;lix
Vin&#237;cius F&#233;lix

Reputation: 8811

i <- 10:109

sum(i^3 + 4*i^2)

[1] 37687400

Upvotes: 2

Related Questions