Nothing Nevermind

Nothing . I will do it myself

Do you know about the fs :package: ?

I think you'll find some of the function useful. fs::dir_info() will apply something like file.info on the file into the directory. You'll just have to filter with the one you want to keep based on size.
The results is already in tibble format so you can even easily use dplyr to manipulate the result.

Example on the R home directory

library(fs)
tab <- dir_info(path = R.home())
dplyr::glimpse(tab)
#> Observations: 17
#> Variables: 18
#> $ path              <fs::path> "C:/PROGRA~1/R/R-3.5.1/bin", "C:/PROGRA...
#> $ type              <fct> directory, file, file, directory, directory,...
#> $ size              <fs::bytes> 0, 26.78K, 17.59K, 0, 0, 0, 0, 434.74K...
#> $ permissions       <fs::perms> rw- , rw- , rw- , rw- , rw- , rw- , rw...
#> $ modification_time <dttm> 2018-08-18 10:59:34, 2018-07-02 10:13:12, 2...
#> $ user              <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ...
#> $ group             <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ...
#> $ device_id         <dbl> 3168585071, 3168585071, 3168585071, 31685850...
#> $ hard_links        <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,...
#> $ special_device_id <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
#> $ inode             <dbl> 2.476980e+16, 1.942177e+16, 1.801440e+16, 3....
#> $ block_size        <dbl> 4096, 4096, 4096, 4096, 4096, 4096, 4096, 40...
#> $ blocks            <dbl> 0, 56, 40, 8, 8, 8, 8, 872, 0, 16, 24, 8, 0,...
#> $ flags             <int> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
#> $ generation        <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
#> $ access_time       <dttm> 2018-08-18 10:59:34, 2018-08-18 10:59:34, 2...
#> $ change_time       <dttm> 2018-08-18 10:59:34, 2018-08-18 10:59:34, 2...
#> $ birth_time        <dttm> 2018-08-18 10:59:31, 2018-08-18 10:59:34, 2...

Created on 2018-10-02 by the reprex package (v0.2.1)

1 Like