Convert a directory tree to a mindmap file.

tree2mm(tree, savefile = TRUE, savefilename = "mindr", backup = TRUE, n_root = 1)

Arguments

tree

character. The directory tree.

savefile

logical. Whether to save the output as a file.

savefilename

character. Valid when savefile == TRUE.

backup

logical. Whether the existing target file, if any, should be saved as backup.

n_root

numeric. Which element is the root of the tree.

Value

a mindmap file, which can be viewed by common mindmap software, such as 'FreeMind' (http://freemind.sourceforge.net/wiki/index.php/Main_Page) and 'XMind' (http://www.xmind.net).

Examples

et2 <- c("/Root name", "/Path A", "/Path A/Product A", "/Path A/Product A/Process A", "/Path A/Product A/Process A/Step A", "/Path A/Product A/Process A/Step A/Record 1", "/Path A/Product A/Process A/Step A/Record 1/Analyses", "/Path A/Product A/Process A/Step A/Record 1/Analyses/Object 1", "/Path A/Product A/Process A/Step A/Record 1/Analyses/Object 1/Type: data source", "/Path A/Product A/Process A/Step A/Record 1/Analyses/Object 1/Version: 3", "/Path A/Product A/Process A/Step A/Record 1/Analyses/Object 2", "/Path A/Product A/Process A/Step A/Record 1/Analyses/Object 3", "/Path A/Product A/Process A/Step A/Record 1/Setup Parts", "/Path A/Product A/Process A/Step A/Record 1/Setup Parts/Par 1", "/Path A/Product A/Process A/Step A/Record 1/Setup Parts/Par 2", "/Path A/Product A/Process A/Step A/Record 1/Setup Parts/Par 3", "/Path B", "/Path C") tree2mm(et2)
#> [1] "<map version=\"1.0.1\">" #> [2] "<node TEXT=\"Root name\">" #> [3] "<node TEXT=\"Path A\">" #> [4] "<node TEXT=\"Product A\">" #> [5] "<node TEXT=\"Process A\">" #> [6] "<node TEXT=\"Step A\">" #> [7] "<node TEXT=\"Record 1\">" #> [8] "<node TEXT=\"Analyses\">" #> [9] "<node TEXT=\"Object 1\">" #> [10] "<node TEXT=\"Type: data source\"></node>" #> [11] "<node TEXT=\"Version: 3\"></node></node>" #> [12] "<node TEXT=\"Object 2\"></node>" #> [13] "<node TEXT=\"Object 3\"></node></node>" #> [14] "<node TEXT=\"Setup Parts\">" #> [15] "<node TEXT=\"Par 1\"></node>" #> [16] "<node TEXT=\"Par 2\"></node>" #> [17] "<node TEXT=\"Par 3\"></node></node></node></node></node></node></node>" #> [18] "<node TEXT=\"Path B\"></node>" #> [19] "<node TEXT=\"Path C\"></node>" #> [20] "</node></map>"