View source: R/detect_categoricals.R
| detect_categoricals | R Documentation |
Returns a logical named vector indicating which columns are likely
categorical. Character and factor columns are always flagged. Numeric
columns with fewer than max_unique unique values are also flagged.
detect_categoricals(df, max_unique = 10L)
df |
A data frame. |
max_unique |
Integer. Numeric columns with this many or fewer unique values are flagged as likely categorical. Default is 10. |
A named logical vector with one element per column. TRUE indicates
the column is likely categorical.
df <- data.frame(
price = c(100, 200, 300, 400),
pool = c("Y", "N", "Y", "N"),
bedrooms = c(2, 3, 2, 4),
sqft = c(1200, 1500, 1300, 1800)
)
detect_categoricals(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.