[R] Use R to plot a directory tree

Thaler,Thorn,LAUSANNE,Applied Mathematics Thorn.Thaler at rdls.nestle.com
Thu Oct 24 15:13:11 CEST 2013

Dear all,

I was wondering whether (or better: how) I can use R to read recursively a directory to get all the sub-folders and files located in the root folder and put it into a tree like structure where the leaves are files and intermediate nodes are the directories? The idea is that I'd like to plot the structure of a certain root folder to be able to restructure the file system.

Any ideas on that? I was googling a lot but apparently I did not use the right terms ("R tree folder" or "R tree directory" takes me mainly to pages about the "R-tree" a structure for spatial access methods [at least I learnt something new ;)])

Any pointer to the right function is highly appreciated.


Thorn Thaler 
NRC Lausanne
Applied Mathematics

More information about the R-help mailing list