We at STATWORX work a lot with R and we often use the same little helper functions within our projects. These functions ease our daily work life by reducing repetitive code parts or by creating overviews of our projects. At first, there was no plan to make a package, but soon I realised, that it will be much easier to share and improve those functions, if they are within a package. Up till the 24th December I will present one function each day from
helfRlein. So, on the 14th day of Christmas my true love gave to me…
What can it do?
This little helper returns the folder structure of a given path. With this, one can for example add a nice overview to the documentation of a project or within a git. For the sake of automation, this function could run and change parts wihtin a log or news file after a major change.
How to use it?
If we take a look at the same example we used for the
get_network function on day 5, we get the following:
print_fs("~/flowchart/", depth = 4)
1 flowchart 2 ¦--create_network.R 3 ¦--getnetwork.R 4 ¦--plots 5 ¦ ¦--example-network-helfRlein.png 6 ¦ °--improved-network.png 7 ¦--R_network_functions 8 ¦ ¦--dataprep 9 ¦ ¦ °--foo_01.R 10 ¦ ¦--method 11 ¦ ¦ °--foo_02.R 12 ¦ ¦--script_01.R 13 ¦ °--script_02.R 14 °--README.md
depth we can adjust how deep we want to traverse through our folders.
Have a merry advent season!