Displaying 2 results from an estimated 2 matches for "forval".
Did you mean:
formal
2007 Oct 24
3
how to loop over a group of variables?
Hi All,
I have a data frame with a group of variables named b1, b2, b3, ..., b18. These variables take the value 1, 2 or NA. For each observation, I want to do some computation by looping over the values for the group of variables: b1 to b18. In STATA I would do:
forval i=1/18 {
--- use b`i' for computation ----
}
How can this be done in R?
Deepankar
2007 Oct 25
2
the difference between temp and .temp
...ll,
> >
> > I have a data frame with a group of variables named b1, b2, b3, ..., b18. These variables take the value 1, 2 or NA. For each observation, I want to do some computation by looping over the values for the group of variables: b1 to b18. In STATA I would do:
> >
> > forval i=1/18 {
> > --- use b`i' for computation ----
> > }
> >
> > How can this be done in R?
> >
> > Deepankar
> >
> > ______________________________________________
> > R-help at r-project.org mailing list
> > https://stat.ethz.ch/mailman...