> fit <- rpart(price ~ carat + cut + clarity, diamonds_train, method = "anova")
> rpart.plot(fit, type = 4, extra = 101)
I tried options(scipen=10)
but it didn't work. How can I remove the scientific notation?
Use a negative value for the digits
argument. The rpart.plot
help page says that if digits
is negative, rpart.plot
uses the standard R format
function (with the absolute value of digits
):
library(ggplot2)
data(diamonds)
library(rpart.plot)
fit <- rpart(price ~ carat + cut + clarity, diamonds, method = "anova")
rpart.plot(fit, type = 4, extra = 101, digits=-3)
This requires rpart.plot
version 2.1.2 or higher. You may have play with the value digits=-3
to get the exact display you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With