# NOT RUN {
# normal mode
Mode(c(0:5, 5))
Mode(5)
Mode(NA)
Mode(c(NA, NA))
Mode(c(NA, 0:5))
Mode(c(NA, 0:5), na.rm=TRUE)
Mode(c(NA, 0:5, 5), na.rm=TRUE)
# returns all encountered modes, if several exist
Mode(c(0:5, 4, 5, 6))
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