why is only mean and max infinity in r

# Create a numeric vector with some values
vec <- c(1, 2, 3, 4, 5, NA)

# Calculate the mean of the vector, excluding NA values
mean_value <- mean(vec, na.rm = TRUE)

# Print the mean value
print(mean_value)

# Calculate the maximum value of the vector, treating NA as infinity
max_value <- max(vec, na.rm = TRUE, na.rm.inf = TRUE)

# Print the maximum value
print(max_value)