|
- library(tidyverse)
-
- # Classification
-
- data(iris)
-
- (
- iris %>%
- ggplot() +
- aes(x = Petal.Width, y = Sepal.Width, color = Species) +
- geom_point()
- ) %>%
- ggsave(plot = ., filename = "classif.png")
-
-
- library(rpart)
-
- rpart(Species ~ ., data = iris) %T>%
- plot(branch = .5, margin = .5) %>%
- text(use.n = T, all = T, pretty = T, fancy = T)
|