max and min R Functions (2 Programming Examples) | Maximum & Minimum

preview_player
Показать описание

The example R code of this video can be found below:

# Example 1

x1 <- c(4, 1, - 50, 20, 8) # Create example vector

max(x1) # Apply max to vector
min(x1) # Apply min to vector

# Example 2

x2 <- c(x1, NA) # Create example vector with NA

max(x2) # max returns NA

Рекомендации по теме
Комментарии
Автор

So easy! Thanks! I searched around on Stack Overflow and everyone made it so complicated.

abigailspencer
join shbcf.ru