plot_file_distribution: Plot Distributions of Files in Folder Depths and Name...

View source: R/plot_file_distribution.R

plot_file_distributionR Documentation

Plot Distributions of Files in Folder Depths and Name Summaries

Description

Plot Distributions of Files in Folder Depths and Name Summaries

Usage

plot_file_distribution(file_data, start_path, n_root_parts, ..., to_pdf = TRUE)

Arguments

file_data

data frame with columns path, type, size

start_path

only paths from file_data are considered that start with this path

n_root_parts

number of first path segments to be considered as "root"

...

further arguments passed to kwb.fakin:::plot_file_size_in_depth

to_pdf

if TRUE (default) the results are plotted into a temporary pdf file that is opened in a pdf viewer

Examples

# Set a seed for the random number generator
set.seed(20190625)

# Create random paths
paths <- kwb.pathdict::random_paths()

# Number of paths
n <- length(paths)

# Create artificial file data (invent sizes)
file_data <- kwb.utils::noFactorDataFrame(
  path = paths,
  type = "file",
  size = abs(rnorm(n)) * kwb.fakin:::bytes_to_mib(
    2^sample(30, n, replace = TRUE)
  )
)

kwb.fakin::plot_file_distribution(
  file_data, start_path = "reason", n_root_parts = 1, to_pdf = FALSE
)


KWB-R/kwb.fakin documentation built on June 14, 2022, 2 p.m.