Package 'detector'

Title: Detect Data Containing Personally Identifiable Information
Description: Allows users to quickly and easily detect data containing Personally Identifiable Information (PII) through convenience functions.
Authors: Paul Hendricks [aut, cre]
Maintainer: Paul Hendricks <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0.9000
Built: 2024-11-03 02:48:30 UTC
Source: https://github.com/paulhendricks/detector

Help Index


Detect if a data object contains PII.

Description

Detect if a data object contains PII.

Usage

detect(.x)

## Default S3 method:
detect(.x)

## S3 method for class 'character'
detect(.x)

## S3 method for class 'data.frame'
detect(.x)

Arguments

.x

A data object.

Value

A logical value indicating if that data object contains PII.

Methods (by class)

  • default: Method for default vectors.

  • character: Method for character vectors.

  • data.frame: Method for data.frames.

Examples

# atomic vectors
detect(letters)
detect(1:10)
detect(as.Date("2014-01-01"))

# data.frames
detect(mtcars)

detector: Detect Data Containing Personally Identifiable Information

Description

detector: Detect Data Containing Personally Identifiable Information


Test if a character vector has any e-mail addresses.

Description

Test if a character vector has any e-mail addresses.

Usage

has_email_addresses(.x)

Arguments

.x

A character vector.

Value

A logical value indicating if that string has any e-mail addresses.

Examples

# Examples
has_email_addresses("hello") # FALSE
has_email_addresses("[email protected]") # TRUE

Test if a character vector has any national identification numbers.

Description

Test if a character vector has any national identification numbers.

Usage

has_national_identification_numbers(.x)

Arguments

.x

A character vector.

Value

A logical value indicating if that string has any national identification numbers.

Examples

# Examples
# Examples
has_national_identification_numbers("hello") # FALSE
has_national_identification_numbers(65884) # FALSE
has_national_identification_numbers("111-33-5555") # TRUE
has_national_identification_numbers(1113335555) # FALSE

Test if a character vector has any phone numbers.

Description

Test if a character vector has any phone numbers.

Usage

has_phone_numbers(.x)

Arguments

.x

A character vector.

Value

A logical value indicating if that string has any phone numbers.

Examples

# Examples
has_phone_numbers("hello") # FALSE
has_phone_numbers(65884) # FALSE
has_phone_numbers("111-333-5555") # TRUE
has_phone_numbers(1113335555) # TRUE

Test if a string is an e-mail address.

Description

Test if a string is an e-mail address.

Usage

is_email_address(.x)

Arguments

.x

A character vector.

Value

A logical value indicating if that string is an e-mail address.

Examples

# Examples
is_email_address("hello") # FALSE
is_email_address("[email protected]") # TRUE

Test if a string is a national identification number.

Description

Strictly works for only US national identification numbers.

Usage

is_national_identification_number(.x)

Arguments

.x

A string or numeric vector.

Value

A logical value indicating if that string is a national identification number.

Examples

# Examples
is_national_identification_number("hello") # FALSE
is_national_identification_number(65884) # FALSE
is_national_identification_number("111-33-5555") # TRUE
is_national_identification_number(1113335555) # FALSE

Test if a string is a phone number.

Description

Strictly works for only US phone numbers.

Usage

is_phone_number(.x)

Arguments

.x

A string or numeric vector.

Value

A logical value indicating if that string is a phone number.

Examples

# Examples
is_phone_number("hello") # FALSE
is_phone_number(65884) # FALSE
is_phone_number("111-333-5555") # TRUE
is_phone_number(1113335555) # TRUE