Skip to content

vectorization

1 message · Liaw, Andy

#
Here I go again with ave():

mydata$md <- ave(mydata$income, mydata$education, FUN=median, na.rm=TRUE)

IMHO it's one of the most under-rated helper functions in R.

Andy