find_maximum_value: Find the maximum numeric value in a vector, ignoring...

View source: R/create_dataset_summary_table.R

find_maximum_valueR Documentation

Find the maximum numeric value in a vector, ignoring non-numeric values

Description

Find the maximum numeric value in a vector, ignoring non-numeric values

Usage

find_maximum_value(numeric_vector)

Arguments

numeric_vector

A vector from which to find the maximum numeric value.

Value

The maximum numeric value in the input vector, or NA if none exist.

Examples

# Find the maximum of a numeric vector
find_maximum_value(c(3, 1, 4, 1, 5, 9)) # Returns   9

# Find the maximum of a mixed vector with non-numeric values
find_maximum_value(c(3, 1, 4, "two", 5, 9)) # Returns   9

# Attempt to find the maximum of a vector with only non-numeric values
find_maximum_value(c("one", "two", "three")) # Returns NA

vvauditor documentation built on May 29, 2024, 12:20 p.m.