Skip to content
Prev 314918 / 398506 Next

Basic loop programming

Hi
Hm. Why do you want to do it in R if you prefer other languages? Did you find R by accident or are you prepared to use it in future? If you want to use it, it is just right time to learn some basics.

Anyway, if you have 2 vectors, call them sales and customers, you can just do

av.revenue <- sales/customers

Until you do not provide more info about your data e.g. by at least some of

?head, ?str or preferably ?dput

you hardly get some suitable advice.

Regards
Petr