is.valid: Validate numbers

Description Usage Arguments Value Examples

View source: R/util.R

Description

Validates the brazilian numbers when it is necessary. Not all identification numbers don't have a validation algorithm.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
is.valid(x)

## S3 method for class 'CNPJ'
is.valid(x)

## S3 method for class 'CPF'
is.valid(x)

## S3 method for class 'RENAVAN'
is.valid(x)

Arguments

x

the identification number class.

Value

A logical vector indicating whether the number is valid or not.

Examples

1
2
3
is.valid(CNPJ(c(13515463000138, 66670000101))) # TRUE, FALSE
is.valid(CPF(c(1239157673, 42752486198))) # TRUE, FALSE
is.valid(RENAVAN(c(75320797785, 42752486198))) # TRUE, FALSE

wilsonfreitas/numbersBR documentation built on May 4, 2019, 6:28 a.m.