Apply a function to each row in a data frame in R

67,374

You want apply (see the docs for it). apply(var,1,fun) will apply to rows, apply(var,2,fun) will apply to columns.

> apply(a,1,min)
[1] 1 0 3
Share:
67,374
highBandWidth
Author by

highBandWidth

Updated on March 19, 2020

Comments