odd_val_col: Checking Columns for NA, Negative or Other (Odd) Values and...

View source: R/odd_val_col.R

odd_val_colR Documentation

Checking Columns for NA, Negative or Other (Odd) Values and Returning an easy to inspect dataframe with meaningful reference columns that don't have NAs

Description

Checking Columns for NA, Negative or Other (Odd) Values and Returning an easy to inspect dataframe with meaningful reference columns that don't have NAs

Usage

odd_val_col(df, refCols = c(1, 2), oddValues = "NAs", verbose = TRUE)

Arguments

df

Dataframe in which to check for odd values.

refCols

The columns that will be presented in the output. Passed to a If "dist" or "ac" are typed in, the function selects the pairs STATE/DISTRICT_NAME and ST_NAME/AC_NO.

oddValues

The type of odd values with three options. The default "na" checks all types of missing values in Consumer Pyramids. The option "negative" checks if any numeric column is negative. Alternatively, a string vector can be supplied that will used to check.

verbose

Whether to print messages to the console.

df_type

as refCols.

Details

The states argument calls exclude_states

Value

A tibble with the rows where the odd values where found.

Examples


x <- na_if(mtcars, 0)

odd_val_col(x)


AltfunsMA/cptools documentation built on Aug. 7, 2022, 5:44 p.m.