Skip to contents

This function computes the maximum of two numeric columns for each observation. NA values are handled such that if one value is NA and the other is not, the non-NA value is returned. If both values are NA, NA is returned.

Usage

get_max_of_two_columns(df, col1, col2)

Arguments

df

A data frame with at least two numeric columns.

col1

The name of the first numeric column.

col2

The name of the second numeric column.

Value

A numeric vector containing the maximum value for each observation.