I am conducting a regression tree using state sequence analysis and I want the image output to have the dimensions of a Letter size paper (landscape).
When I use the code I include the regression tree appears as a separate window, always of the same size, and the actual file in my computer is empty. I have to "Save as" the window that pops in order to get the regression tree, but the size is even (width, height). I would appreciate any help:
st_tk <- seqtree(tk.seq ~ Gender + age_groups + race_eth + Paying_rec + Marital +
Education_rec + Pop + Employment_rec + Housing + Criminal +
alcohol + cocaine + cannabis + meth + benzo + diff_opioid +
opioid_route + sum_comor + site,
data = df_seq_tree,
R = 5000,
diss = dist.dhd,
weight.permutation = "diss",
max.depth = 10,
pval = 0.05)
# Save the regression tree as a PNG image
png("Output/Takehome/Reg_tree/st_tk.png", width = 11, height = 8.5)
seqtreedisplay(st_tk, type = "d", border = NA, image.format = "png", gvpath = 'C:/Program Files/Graphviz',
cex.main = 2)
dev.off()
Thanks in advance!