Skip to content

Instantly share code, notes, and snippets.

@fabiojwalter
Last active October 17, 2020 22:59
Show Gist options
  • Save fabiojwalter/0d7beee5704240981a2034628ce93162 to your computer and use it in GitHub Desktop.
Save fabiojwalter/0d7beee5704240981a2034628ce93162 to your computer and use it in GitHub Desktop.
R Language - Convert features to Factors and Analyze them
library(tidyverse)
library(summarytools)
df <- churn %>%
mutate_if(sapply(churn, is.character), as.factor) %>%
mutate_if(sapply(churn, is.double), as.factor)
dfSummary(df, style = "grid", justify = "r", round.digits = 2)
@fabiojwalter
Copy link
Author

Sample output

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment