This function will determine the maximum value in a each row of a data frame

row_max(data, na.rm = FALSE)

Arguments

data

A data frame

na, rm

Logical. If TRUE the function will ignore NA values. If FLASE then the function will return a NA.

Value

A vector of the maximum values of each row of data. If a row has no values (i.e. all values are NA then the function will return a NA.

Examples

if (FALSE) {

set.seed(1)
df <- data.frame(X = rnorm(10, mean = 3, sd = 2),
                 Y = c(NA, rnorm(9, mean = 5, sd = 0.5)))

row_max(df, na.rm = TRUE)

row_max(df, na.rm = FALSE)

}