Advertisement
897bhgy

Untitled

Jul 11th, 2023 (edited)
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 0.38 KB | Source Code | 0 0
  1. # Load necessary library
  2. library(readxl)
  3.  
  4. # Load data from an Excel file
  5. credit <- read_excel("YourFolderName/CreditCardUpgrade.xlsx")
  6.  
  7. # Convert 'upgraded' and 'extraCards' columns to factors with levels 'No' and 'Yes'
  8. credit$upgraded <- factor(credit$upgraded, levels=c(0,1), labels=c("No","Yes"))
  9. credit$extraCards <- factor(credit$extraCards, levels=c(0,1), labels=c("No","Yes"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement