check_df: Special checks

Description Usage Arguments Details Value See Also Examples

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## 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)

hablar documentation built on March 26, 2020, 7:56 p.m.