| check_cat | R Documentation |
This function reports information for the categories, mainly the frequencies, proportions and missing values
check_cat(x, missing = c(-999, NA), detail = 5, threshold = c(NA, NA))
x |
numeric vector with the categories |
missing |
vector with the values that present missing information |
detail |
numeric with he level of detail to print (see below for details) |
threshold |
numeric vector with the threshold numbers and proportions (see details) |
The detail argument can be used to print certain information:
5: All possible information is printed
4: Only the table with frequencies and proportions
3: Only information regarding missing data
2: Only a warning in case number of missing is above threshold (see below)
1: A named vector with the available categories that can be used in num_lump The threshold presents the absolute number (first number) and proportions (second number) to check. If either one of these numbers is above the threshold for missing values, a warning is given. This can be convenient to decide whether or not a category should be used during analyses.
Nothing is returned information is printed on screen
Richard Hooijmaijers
dfrm <- data.frame(cat1 = c(rep(1:5,10),-999),
cat2 = c(rep(letters[1:5],10),-999))
check_cat(dfrm$cat1)
check_cat(dfrm$cat2, detail=1)
check_cat(dfrm$cat1,detail=2,threshold = c(NA,0.1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.