Skip to contents

Converts specified columns in a data frame to numeric, with a guard against non-digit content. Stops if letters are detected in any column; warns if silent coercion was needed.

Usage

coerce_numeric(d, vars)

Arguments

d

A data.frame.

vars

Character vector of column names to coerce.

Value

The data frame with the specified columns coerced to numeric.