carmellose carmellose - 1 year ago 69
R Question

Compute the size of directory in R

I want to compute the size of a directory in R. I tried to use the
function, by unfortunably that follows the symbolic links so my results are biased:

# return wrong size, with duplicate counts for symlinks
sum( = '/my/directory/', recursive = T, full.names = T))$size)

How do I compute the file size of a directory, so that it gives me the same result as on Linux, e.g. with
du -s
for example?


Answer Source

I finally used this:

system('du -s')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download