Learn R Programming

vannstats (version 1.5.1.8)

mode: Mode Function

Description

This function returns the mode for a given data frame.

Usage

mode(x, na.rm = FALSE)

Value

This function returns the mode for a variable within a data frame or a list of values.

Arguments

x

variable within data frame or a list of values.

na.rm

remove the NAs, default is FALSE.

Examples

Run this code

data <- mtcars

mode(data$mpg)

Run the code above in your browser using DataLab