powered by
Calculates the mode, the most frequent value, of a variable x. This makes mostly sense for qualitative data.
Mode(x, na.rm = FALSE)
a (non-empty) numeric vector of data values.
logical. Should missing values be removed? Defaults to FALSE.
Returns the most frequent value. If there are more than one, all of them are returned in a vector.
https://stackoverflow.com/questions/55212746/rcpp-fast-statistical-mode-function-with-vector-input-of-any-type/ https://stackoverflow.com/a/55213471/8416610
mean, median
mean
median
# NOT RUN { data(d.pizza) Mode(d.pizza$driver) # use sapply for evaluating data.frames (resp. apply for matrices) sapply(d.pizza[,c("driver","temperature","date")], Mode, na.rm=TRUE) # }
Run the code above in your browser using DataLab