print_dir_ul | R Documentation |
This function will create an unordered list of all the files in a directory and print the output. It should be used in conjunction with RMarkdown and knitr. Specifically, you want to call it within an R chunk that has the results set to 'asis'.
print_dir_ul(path = ".", remove = NULL, nested = FALSE)
path |
The path to the directory of which you want to print the structure |
remove |
A regular expression to subset the output |
nested |
(logical) If false, creates unordered list of current directory only. Otherwise, subdirectories within current directory (1 level) are also included in the list. |
# In any directory
print_dir_ul()
# To specify the path
print_dir_ul(path = "./")
# All files that are not .txt
print_dir_ul(remove = ".txt")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.