The first argument ofheat_tree(),data isnow replaced withx, which can be a dataframe (or tibble),a party (or constparty) object specifying the precomputed tree, orpartynode object specifying the customized tree.custom_tree argument is no longer needed.
Please make sure your version of R >= 3.5.0 beforeinstallation.
You can install the released version oftreeheatrfrom CRAN with:
install.packages('treeheatr')Or the development version from GitHub with remotes:
# install.packages('remotes') # uncomment to install devtoolsremotes::install_github('trang1618/treeheatr')Classification of different types of penguin species.
library(treeheatr)heat_tree(penguins,target_lab ='species')
Classification of different cultivars of wine.
heat_tree(wine,target_lab ='Type',target_lab_disp ='Cultivar')
If you use treeheatr in a scientific publication, please considerciting the following paper:
Le TT, Moore JH.treeheatr: an Rpackage for interpretable decision tree visualizations.Bioinformatics. 2020 Jan 1.
BibTeX entry:
@article{le2020treeheatr,title={treeheatr: an R package for interpretable decision tree visualizations},author={Le, Trang T and Moore, Jason H},journal={Bioinformatics},year={2020},doi="10.1093/bioinformatics/btaa662"}treeheatr incorporates a heatmap at the terminalnode of your decision tree. The basic building blocks to atreeheatr plot are (yes, you guessed it!) a decisiontree and a heatmap.
The decision tree is computed withpartykit::ctree()and plotted with the well-documented and flexibleggpartypackage. The tree parameters can be passed toggpartyfunctions via theheat_tree() anddraw_tree()functions oftreeheatr. More details on differentggpartygeoms can be foundhere.
The heatmap is shown withggplot2::geom_tile(). Theuser may choose to cluster the samples within each leaf node or thefeatures across all samples.
Make sure to check out thevignettefor detailed information on the usage oftreeheatr.
Pleaseopen anissue for questions related totreeheatr usage, bugreports or general inquiries.
Thank you very much for your support!