Title: | Creates an Interactive Tree Structure of a Directory |
---|---|
Description: | Represents the content of a directory as an interactive collapsible tree. Offers the possibility to assign a text (e.g., a 'Readme.txt') to each folder (represented as a clickable node), so that when the user hovers the pointer over a node, the corresponding text is displayed as a tooltip. |
Authors: | Louis Sirugue [aut, cre] |
Maintainer: | Louis Sirugue <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0.0 |
Built: | 2024-11-10 05:15:00 UTC |
Source: | https://github.com/louissirugue/directotree |
Represents the content of a directory as an interactive collapsible tree. Offers the possibility to assign a text (e.g., a 'Readme.txt') to each folder (represented as a clickable node), so that when the user hovers the pointer over a node, the corresponding text is displayed as a tooltip.
directotree(yourPath, showWd = FALSE, warnMe = FALSE, addReadme = FALSE, attributeName = '', hiddenFiles = c('Thumbs.db'), showRawTree = FALSE, showCollapsibleTree = TRUE, tooltip = FALSE, linkLength = 150, collapsed = TRUE, zoomable = TRUE, width = 1240, height = 700, fontSize = 15, fill = 'lightblue', nodeSize = 'leafCount')
directotree(yourPath, showWd = FALSE, warnMe = FALSE, addReadme = FALSE, attributeName = '', hiddenFiles = c('Thumbs.db'), showRawTree = FALSE, showCollapsibleTree = TRUE, tooltip = FALSE, linkLength = 150, collapsed = TRUE, zoomable = TRUE, width = 1240, height = 700, fontSize = 15, fill = 'lightblue', nodeSize = 'leafCount')
yourPath |
The path of the directory you want to build a interactive representation of. It must be a string, and make sure to use / instead of \. |
showWd |
If TRUE, R prints each directory it goes in to attach files/folders to the parent node. |
warnMe |
If TRUE, R prints a Warning when an empty folder is detected, and indicates its location. |
addReadme |
If TRUE, the content of the files whose name must be specified in attributeName, will be attached to each corresponding folder. For instance, if in some subfolders of yourPath, some Readme.txt files describe the content of the said folders, by setting addReadme to TRUE and attributeName to 'Readme.txt', the description written in the Readme.txt files will be attached to the nodes of the corresponding folders as a tooltip (tooltip must be set to TRUE). |
attributeName |
If addReadme is set to TRUE, attributeName must be filled with the name of the files whose content should be displayed as tooltips (e.i., 'Readme.txt', 'README.txt', 'info.txt', etc.). |
Vector of strings that must contain the names of the files that must not be displayed in the tree. For instance, you may want to display the content of some 'Readme.txt' files as tooltips, without them being showed as leaves of the tree. |
|
showRawTree |
It TRUE, the tree structure is printed in the console. |
showCollapsibleTree |
If TRUE, calls the collapsibleTree function to build the interactive tree. |
tooltip |
If TRUE, it shows the node’s label and attribute value. |
linkLength |
Length of the horizontal links that connect nodes in pixels. |
collapsed |
If TRUE, the tree’s children will start collapsed by default. |
zoomable |
Pan and zoom by dragging and scrolling. |
width |
Width in pixels. |
height |
Height in pixels. |
fontSize |
Font size of the label text in pixels. |
fill |
A tree attribute containing the color for each node. |
nodeSize |
Numeric column that will be used to determine relative node size. ’leafCount’ (cumulative count of a node’s children), or ’count’ (count of node’s immediate children) can also be used. |
Louis Sirugue
<https://cran.r-project.org/web/packages/data.tree/data.tree.pdf>
<https://cran.r-project.org/web/packages/collapsibleTree/collapsibleTree.pdf>
directotree(getwd(), addReadme = FALSE, tooltip = FALSE, showRawTree = FALSE, showCollapsibleTree = TRUE, hiddenFiles = c('Readme.txt', 'Thumbs.db'))
directotree(getwd(), addReadme = FALSE, tooltip = FALSE, showRawTree = FALSE, showCollapsibleTree = TRUE, hiddenFiles = c('Readme.txt', 'Thumbs.db'))