[R] Folder size

Luca Cerone luca.cerone at gmail.com
Sun Mar 1 12:59:57 CET 2015


Hi Christopher,

sum(file.info(list.files(".", all.files = TRUE, recursive = TRUE))$size)

should do the trick.

Cheers,
Luca

On Sun, Mar 1, 2015 at 12:33 PM, Christofer Bogaso
<bogaso.christofer at gmail.com> wrote:
> Hi again,
>
> I am wondering if there is any way to extract the Folder size. For
> example, I want to get information of size for all folders in my C:
> drive.
>
> It seems that the function file.info() only work for File, not on Folder.
>
> Appreciate any pointer.
>
> Thanks and regards,
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list