[R] How to modify function for list

Stefan Grosse singularitaet at gmx.net
Wed Oct 3 09:09:56 CEST 2007


On Wednesday 03 October 2007 08:23:15 Chung-hong Chan wrote:
CC >
CC > Suppose I have a long list of age, gender and bmi from a data.frame
CC > called msltdata.
CC >
CC > > age <- msltdata$age
CC > > gender <- msltdata$data
CC > > bmi <-msltdata$bmi
CC > > age
CC > [1]  5 10 14
CC > > gender
CC > [1] 0 0 0
CC > Levels: 0 1
CC > > bmi
CC > [1] 17.17693 16.40702 16.87695
CC > > mapply(bmisds,age,gender,bmi)

have you tried 
bmisds(msltdata$age,msltdata$data,msltdata$bmi)
?



More information about the R-help mailing list