Cat | R Documentation |
Creates objects of type "hd_Cat". hd_Cat objects contain three main attributes: categories, n_categories and stats. With categories you can check wich values are valid for the variable. With n_categories you can check how many of valid values are valid for the variable. With the last attribute, stats, you can check different basic operations to describe the varaible (n_unique, n_na, pct_na and summary).
Cat(x = character(), categories = NULL, skip_stats = FALSE)
x |
object to be created as Cat type |
categories |
an optional character vector of labels for the categories |
skip_stats |
a logical evaluating to TRUE or FALSE indicating whether variable stats should be calculated and added to the hd_Cat object. The stats are n of unique categories, n of NA values, percentage of NA values and a frequency table. |
x <- c("Apple","Banana", "Banana", "Lemons", NA)
cats <- new_Cat(x)
class(cats)
attr(cats, "stats")
attr(cats, "categories")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.