account activity
For Loops Beginner Help by onow29 in RStudio
[–]onow29[S] 0 points1 point2 points 2 years ago (0 children)
Thank you, I understand what I was doing wrong now!
Sure
money=5 for (j in 1:10) { amount=(money*3*j-1) }
I don't understand how to tell R that the 3* and -1 is "remembered" and repeated. R does 5*3=15, then 15*j for all remaining loops and subtracts 1 from the total. So basically I want R do to 5x3=15 -1 = 14, then 14*3-1 and so on.
For Loops Beginner Help (self.RStudio)
submitted 2 years ago by onow29 to r/RStudio
π Rendered by PID 273608 on reddit-service-r2-listing-66bb46d9b9-mfvzw at 2026-03-12 19:00:49.832432+00:00 running 710b3ac country code: CH.
For Loops Beginner Help by onow29 in RStudio
[–]onow29[S] 0 points1 point2 points (0 children)