我正在使用状态序列分析进行回归树,我希望图像输出具有信纸大小的尺寸(横向).
当我使用我包含的代码时,回归树显示为一个单独的窗口,总是大小相同,而我计算机中的实际文件是空的.我必须"另存为"的窗口弹出,以获得回归树,但大小是均匀的(宽度,高度).如果有任何帮助,我将不胜感激:
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()
提前谢谢!