I'm struggling to try to make a CI tree from the 'party' package in R look presentable. So far this is what I have, in terms of cleaning the tree up.
What I would like to do is change the variable names on each individual node to something more descriptive and not just the shortened variable names used for coding. I tried changing the variable names themselves using the following code:
colnames(dat.long.imp.m)[colnames(dat.long.imp.m)=="Gender"] <- "sex"
Because some of the variable names contained spaces, I had to enter them into the 'ctree' function the following way:
ctree(formula = DV ~ "`Executive Copartisan`"
But this gave me an error: Error: attempt to use zero-length variable name. So instead I tried to use the 'apply_labels' function from the 'expss' package, but the labels didn't actually get applied in the ctree plot (as can be seen from the screen grab).
Is there any way to change these variable names to something more descriptive that might include spaces?