Plot Paths as Sankey Network
plot_path_network(
paths,
max_depth = 3,
nodePadding = 8,
nodeHeight = 10,
sinksRight = FALSE,
remove_common_root = TRUE,
names_to_colours = name_to_traffic_light,
height = NULL,
...,
method = 1,
weight_by = c("n_files", "size", "none")[1],
sizes = NULL
)
character vector of paths
maximum depth of paths to be shown
passed to sankeyNetwork
, see
there. Decrease this value (e.g. `nodePadding = 0`) if there are
many nodes to plot and the plot does not look as expected
height of a node in pixels. Used to calculate the total plot height.
passed to sankeyNetwork
, see there
remove the common root parts? (default: TRUE)
if not NULL
expected to be a function that
accepts a vector of (node) names and returns a vector of (colour) names
of same length. This function will be called by plot_path_network
to determine the colour for each node based on its name. By default, the
function name_to_traffic_light
is called.
plot height in pixels, passed to
sankeyNetwork
. If NULL
, the height is
calculated based on nodeHeight
, nodePadding
and the maximum
number of nodes at one folder depth.
further arguments passed to
sankeyNetwork
, such as nodeWidth
,
nodePadding
, fontSize
if 1
(default) the function behaves as before, another
value activates the new preparation of paths accepting/using an object
of class pathlist
one of "n_files", "size", "none"
. Specifies whether
to set the link widths according to the total number or total size of files
in subsequent folders or by setting all links to the same width.
file sizes corresponding to the paths
object representing an HTML page
# Get the paths to all folders on the desktop
paths <- dir(system.file(package = "fakin.path.app"), recursive = TRUE)
# Plot the folder network
plot_path_network(paths)