Description Usage Arguments Value Author(s)
This function takes a dataframe, and for each column, it finds
1) the unique values that exist, and 2) the number of occurrences of each
value. This can be useful when trying to find blunders in data entry, where
an odd value was entered.
Additionally, the function can attempt to find instances where a certain
number of records were categorized with a particular coding via the
target_n
parameter.
1 2 | uniqueValuesPerField(df, cols_ignore = NULL, target_n = NULL,
target_n_wiggle = 0)
|
df |
a dataframe to be analyzed. |
cols_ignore |
the default is |
target_n |
the default is |
target_n_wiggle |
the default is |
a list of column names from the original df, with the unique values found in each, as well as the number of records for each unique value. Fields that were found to be either unique (i.e. every value different) or uniform (i.e. every value the same) will be dropped.
Mike McMahon, Mike.McMahon@dfo-mpo.gc.ca
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.