valid_check_digit: Check for Valid VIN Check Digit

Description Usage Arguments Value Examples

View source: R/valid_check_digit.R

Description

Calculates the VIN check digit and compares it to VIN position 9. For US-based VINs, this determines if the VIN is valid. This may not apply to VINs from outside of the United States.

Usage

1
valid_check_digit(vin, value = FALSE, guess = FALSE)

Arguments

vin

character. The VIN to check. VINs must be compete, i.e. 17 digits with no wildcards.

value

logical. Should the calculated check digit be returned instead?

guess

logical. Should incorrect characters be replaced by the best guess at corrected characters? O -> 0 I -> 1 Q -> 0

Value

If value is FALSE, a logical value is returned. If value is TRUE, a character is returned.

Examples

1
2
3
valid_check_digit("WDBEA30D3HA391172") # True
valid_check_digit("WDBEA30D3HA391172", value = TRUE)
valid_check_digit("WDBEA3QD3HA39I172", guess = TRUE)

vindecodr documentation built on Nov. 25, 2020, 5:07 p.m.