So i have a simple function: bmass=function(y){ weight=y$WT*y$MSTR return(bio) }
And want to apply to a whole bunch of rows in my data.frame: final1=apply(final,1,yldbu) BUT...recieve the following error: "Error in y$WT : $ operator is invalid for atomic vectors" However when i try: > final[1,]$WT*final[1,]$MSTR [1] 156.3 It gives me the correct answer....what is apply not liking in my code? Thanks -- View this message in context: http://r.789695.n4.nabble.com/Apply-giving-me-errors-tp3923880p3923880.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.