Description Usage Arguments Examples
Create Random File Paths Using English Words
1 2 3 4 5 6 | random_paths(
max_depth = 5,
min_chars = 5,
max_elements = 10,
depth_to_leaf_weight = function(depth) 1.2^depth
)
|
max_depth |
maximum path depth |
min_chars |
least number of characters per folder or file name |
max_elements |
maximum number of elements (files or subfolders) in a folder |
depth_to_leaf_weight |
function that calculates a weight from the given path depth. The weight is used to increase the probability of a folder element to be a file and not a subdirectory. By default the weight is calculated by 1.2^depth, i.e. for a folder in depth 10 it is about six times (1.2^10 = 6.19) more probable of its elements to be files instead of subfolders |
1 2 3 4 5 6 7 8 9 10 11 | # Make this example reproducible
set.seed(12059)
# Create random paths
paths <- kwb.pathdict::random_paths(max_depth = 5)
# Show the random paths
paths
# Frequency of path depths
table(lengths(kwb.file::split_paths(paths)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.