check_df {hablar}R Documentation

Special checks

Description

Returns TRUE if data frame have the specified special cases. For example, find_duplicates() returns TRUE if any rows are duplicates. If variables are passed to the function then TRUE or FALSE is returned for those variables.

Usage

check_duplicates(.data, ...)

check_na(.data, ...)

check_irrational(.data, ...)

check_nan(.data, ...)

check_inf(.data, ...)

check_complete_set(.data, ...)

Arguments

.data

a data frame

...

variables that should be considered. If empty, all variables are used.

Details

irrational values are Inf and NaN. 'check_complete_set' tests if all combinations of elements exists in the data frame.

Value

TRUE or FALSE

See Also

find_in_df to return rows instead of TRUE or FALSE. vignette("s"), vignette("hablar")

Examples

## Not run: 
df <- data.frame(a = c("A", NA, "B", "C", "C"),
                 b = c(7, 8, 2, 3, 3),
                 c = c(NA, 1, NaN, 3, 2),
                 stringsAsFactors = FALSE)

# Returns FALSE because there is no duplicates
df %>% check_duplicates()

# Returns TRUE because there is duplicates in column a through b
df %>% check_duplicates(a:b)

# Returns FALSE because there is no NA column b
df %>% check_na(b)

# Returns TRUE because there is no NaN column c
df %>% check_nan(c)

## End(Not run)


[Package hablar version 0.3.2 Index]