Le 28/10/11 00:29, RhoR a écrit :
I want to use
for (i in 1:time)

but I want the increments to be monthly.

For example, if I'm adding interest to a virtual bank account monthly, for a
total of 'time' in years which the user has entered.
If I understand well the problem:

for (i in 1:time) {

        for (j in 1:12) {
                # add the monthly interests
                # total number of months=(i-1)*12+j

        }
}

or simpler:

for (i in 1:(time*12)) {

}

Sincerely

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to