Hi, Vijay.
You can create trees using different packages.
One such package is data.tree.
A simple tree using data.tree.
library(data.tree)
acme <- Node$new("Acme Inc.")
accounting <- acme$AddChild("Accounting")
software <- accounting$AddChild("New Software")
standards <- accounting$AddChild("New Accounting Standards")
research <- acme$AddChild("Research")
newProductLine <- research$AddChild("New Product Line")
newLabs <- research$AddChild("New Labs")
it <- acme$AddChild("IT")
outsource <- it$AddChild("Outsource")
agile <- it$AddChild("Go agile")
goToR <- it$AddChild("Switch to R")
print(acme)
data.tree forms tree from data.frames, file and in a simple small code like the above example.
For more information on data.tree, check it out here.
https://cran.r-project.org/web/packages/data.tree/vignettes/data.tree.html#plotting