Skip to content
Prev 34855 / 398503 Next

create a vector looping over a frame

On Fri, 18 Jul 2003, Siddique, Amer wrote:

            
sumvar <- sapply(popA[ ,4:13], sum)

You can use any function, even a user-written one, in place of sum().
When you see the help for  sapply(), remember that a data.frame is
also a list ("inherits" from list).

-  tom blackwell  -  u michigan medical school  -  ann arbor  -