'How do I clean up this R decision tree specifically get rid of all the values under each node

R output is portraying with all values under the nodes, help me clean this up

click here [1]: https://i.stack.imgur.com/LUxFf.png

I cannot add the data, however here is the code, I am new at this usually I used SAS and SAS Eminer

`enter code here

`install.packages("party")

install.packages("rpart")
install.packages("rattle")
install.packages("rpart.plot")
install.packages("RColorBrewer")




library(rpart)
library(rattle)
library(rpart.plot)
library(RColorBrewer)






fit <- rpart(FPD ~.
              
             
             
             , data = smallfpd
             , method = 'class'
             ,control = rpart.control(minsplit = 10
                                      ,minbucket = 10
                                      ,cp = 0.0001
                                      ,maxdepth = 5))

prp(fit, type=4, extra=101, under=FALSE, faclen=2)
text(fit,pretty)



fit




  
    
A whole bunch of    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L)

ordered = c(Store = FALSE, Mon = FALSE, 
    YYYY = FALSE, Cust_State = FALSE, Campaign = FALSE, CUST_TYPE = FALSE, 
    Req_Loan_Amt = FALSE, PaycheckAmt = FALSE, IncomeMonthly = FALSE, 
    Payroll = FALSE, PayPeriod = FALSE, AGE = FALSE, WithdrawReason = FALSE, 
    Fin_Charge = FALSE, APR = FALSE, LoyaltyLevel = FALSE))

output for dput(head(smallfpd))

structure(list(Store = c(1, 1, 1, 1, 1, 1), Mon = c(12, 12, 10, 
1, 10, 10), YYYY = c(2021, 2021, 2021, 2022, 2021, 2021), FPD = c(0, 
0, 1, 0, 0, 0), Cust_State = c("OH", "AR", "MN", "CA", "CA", 
"FL"), Campaign = c("II10", "LYSC", "PMSE", "PYCA", "LMCA", "YSSC"
), CUST_TYPE = c("NEW", "NEW", "NEW", "NEW", "NEW", "NEW"), Req_Loan_Amt = c("$1,850.00", 
"$3,000.00", "$4,000.00", "$2,400.00", "$2,400.00", "$4,000.00"
), PaycheckAmt = c("$9,999,999,999.00", "$190,000.00", "$41,787.00", 
"$26,000.00", "$25,000.00", "$22,146.43"), IncomeMonthly = c("$9,999,999,999.00", 
"$411,666.67", "$41,787.00", "$56,333.33", "$25,000.00", "$47,983.93"
), Payroll = c("D", "D", "D", "D", "D", "D"), PayPeriod = c("M", 
"B", "M", "B", "M", "B"), AGE = c(63, 46, 38, 46, 72, 29), WithdrawReason = c("Void due to active loan in third party", 
"Void due to active loan in third party", "Void due to active loan in third party", 
"Void due to active loan in third party", "Void due to active loan in third party", 
"Void due to active loan in third party"), Fin_Charge = c("$167.98", 
"$273.70", "$610.96", "$225.10", "$478.61", "$375.16"), APR = c(221.9867, 
221.6611, 222.2844, 218.4176, 221.116, 218.4194), LoyaltyLevel = c(0, 
0, 0, 0, 0, 0)), row.names = c(NA, -6L), class = c("tbl_df", 
"tbl", "data.frame"))


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source