0

I tried to apply Decision Tree classification to my dataset. I created a subset to take useful columns from the raw dataset. The columns: Basin Name, Temperature of field, pH of field. Except basin name, they are numeric. That's why I tried to change the basin name type with ifelse condition. What else can I do to get rid of this error?

library(datasets)
library(caTools)
library(party)
library(dplyr)
library(magrittr)


train <- trainData[,c(9,13,14)]

train$BASIN_NAME <- ifelse(train$BASIN_NAME == "Odra Basin", 1, 2)

colSums(is.na(train))
train <- na.omit(train)

model<- ctree(BASIN_NAME ~ ., train)
plot(model)
ctree(formula, dataset)

However, I got this error message:

Error in valid.viewport(x, y, width, height, just, gp, clip, mask, xscale, : invalid 'yscale' in viewport

sunShine
  • 41
  • 1
  • 9
  • You don't have to change your dependent variable to use `ctree`. It looks like you're new to SO; welcome to the community! If you want great answers quickly, it's best to make your question reproducible. This includes sample data like the output from `dput()` or `reprex::reprex()`. If you can't share your real data, make some or use a built-in set to reproduce the issue. Check it out: [making R reproducible questions](https://stackoverflow.com/q/5963269). – Kat Jan 07 '23 at 16:59

0 Answers0