listToDepth | R Documentation |
List Elements Recursively up to Depth
listToDepth(
path,
max_depth = 0L,
full_info = FALSE,
FUN = listFiles,
...,
depth = 0,
prob_mutate = 0,
template = NULL
)
path |
path to the element at which to start listing |
max_depth |
maximal depth level of which to list elements. A value of
|
full_info |
return only |
FUN |
function called to get the listing of the element given in
|
... |
further arguments passed to |
depth |
start depth of recursion if |
prob_mutate |
probability to alter the path so that it becomes useless. This is zero by default. Set the value only if you want to test how the function behaves if the listing of a path fails. |
template |
empty data frame (zero rows) and with columns that are
identical to the columns in the data frame returned by |
data frame containing at least the columns file
and
isdir
. If full_info = TRUE
the result data frame may contain
further columns, as provided by the function given in FUN
for
full_info = TRUE
.
# Example list function provided in this package (file listing)
FUN <- kwb.utils:::listFiles
# The list function must provide empty records when no path is given. The
# returned data frame must provide the columns "file" and "isdir" ...
FUN()
FUN(full_info = TRUE)
# ... even when being called with an empty character vector
FUN(character())
FUN(character(), full_info = TRUE)
# Call the function recursively up to the given depth level
kwb.utils:::listToDepth(".", max_depth = 1, FUN = FUN)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.