## R min()

R min() function is used to find the minimum value among given arguments.

In this tutorial, we will learn how to use min() function to compute the minimum of given values.

### Syntax

The syntax of `min()` function is

`min(..., na.rm = FALSE)`

where

• `...` are the values of which we have to find the minimum.
• `na.rm` [optional] is a logical value indicating whether missing values should be removed.

### Examples

In the following program, we will find the minimum of three numbers.

example.R

```x <- 16
y <- 25
z <- 9
result <- min(x, y, z)
cat("Minimum value is :", result)```

Output

`Minimum value is : 9`

Now, let us take an array of numbers, and find the minimum of this array.

example.R

```x <- array(c(1, 6, 19), dim=c(3,1))
result <- min(x)
cat("Minimum value is :", result)```

Output

`Minimum value is : 1`

If no argument is provided to min() function, then it returns positive Infinity, along with a warning message.

example.R

```result <- min()
cat("Minimum value is :", result)```

Output

```Warning message:
In min() : no non-missing arguments to min; returning Inf
Minimum value is : Inf```

### Conclusion

In this R Tutorial, we learned how to find the minimum value of given arguments using `min()` function, with the help of examples.