In R, mean()
and median()
are standard functions which do what you\'d expect. mode()
tells you the internal storage mode of the objec
Calculating Mode is mostly in case of factor variable then we can use
labels(table(HouseVotes84$V1)[as.numeric(labels(max(table(HouseVotes84$V1))))])
HouseVotes84 is dataset available in 'mlbench' package.
it will give max label value. it is easier to use by inbuilt functions itself without writing function.