transformBy(formula, data, ...)
The ... arguments are tagged vector expressions, which are evaluated in the data frame data. The tags are matched against names(data), and for those that match, the value replace the corresponding variable in data, and the others are appended to data.
orderBy
,
summaryBy
,
splitBy
,
doby.xtabs
,
data(dietox)
transformBy(~Pig, data=dietox, minW=min(Weight), maxW=max(Weight),
gain=sum(range(Weight)*c(-1,1)))
Run the code above in your browser using DataLab