Dear all, I'd like to get a percentage variable based on a group, but without creating a new data frame. 
For example:
data(iris)

iris$percent <-unlist(tapply(iris$Sepal.Length,iris$Species,function(x) x/sum(x, na.rm=TRUE)))

This does not work, I should have only three standard values, respectively for setosa, versicolor, and virginica. How can I do this?

MANY THANKS,

Karine 
 		 	   		  
	[[alternative HTML version deleted]]

