Package 'rutifier'

Title: Chilean Rol Unico Tributario
Description: A RUT (Rol Unico Tributario) is an unique and personal identification number implemented in Chile to identify citizens and taxpayers. Rutifier allows to validate if a RUT exist or not and change between the different formats a RUT can have.
Authors: Mauricio Santelices
Maintainer: Mauricio Santelices <[email protected]>
License: MIT + file LICENSE
Version: 1.0.4
Built: 2024-11-14 02:42:15 UTC
Source: https://github.com/msantelices/rutifier

Help Index


Clear RUT

Description

Removes any character that is not a number, K, k, dot or hyphen

Usage

clear_rut(rut)

Arguments

rut

Character string

Value

Returns a character string without said characters

Examples

clear_rut('12m345.678-9=')

RUT format: Dots and Hyphen (Puntos y guion)

Description

Changes the format of a RUT to dots and hyphen

Usage

rut_complete(rut, uppercase = FALSE)

Arguments

rut

RUT to modify. It must be a character string

uppercase

Defines if the verification number 'k' should be in uppercase (TRUE) or lowercase (FALSE). By default the value is FALSE

Value

Returns a RUT in dots and hyphen format

Examples

rut_complete('123456789')

RUT format: Hyphen without dots (Sin puntos, con guion)

Description

Changes the format of a RUT to hyphen without dots

Usage

rut_hyphen(rut, uppercase = FALSE)

Arguments

rut

RUT to modify. It must be a character string

uppercase

Defines if the verification number 'k' should be in uppercase (TRUE) or lowercase (FALSE). By default the value is FALSE

Value

Returns a RUT in hyphen without dots format

Examples

rut_hyphen('123456789')

RUT format: Without dots and Hyphen (Sin puntos ni guion)

Description

Changes the format of a RUT to not contain dots or hyphen

Usage

rut_simple(rut, uppercase = FALSE)

Arguments

rut

RUT to modify. It must be a character string

uppercase

Defines if the verification number 'k' should be in uppercase (TRUE) or lowercase (FALSE). By default the value is FALSE

Value

Returns a RUT whitout dots and hyphen

Examples

rut_simple('123456789')

Validate RUT

Description

Validates a Chilean RUT. The input must be a character string in one of the following formats: RUT with dots and hyphen (Ex. '12.345.678-9'), RUT without dots but with hyphen (Ex. '12345678-9') or RUT without dots and hyphen (Ex. '123456789')

Usage

validate_rut(rut)

Arguments

rut

Character str

Value

Returs TRUE if RUT is valid, else it will return FALSE

Examples

validate_rut('123456789')
validate_rut('12345678-9')
validate_rut('12.345.678-9')