USAID-OHA-SI / glamr

SI Utilities
https://usaid-oha-si.github.io/glamr/
Other
2 stars 3 forks source link

Add n() argument to return_latest to allow for returning multiple files. #103

Open tessam30 opened 2 months ago

tessam30 commented 2 months ago

Request to enhance the functionality of return_latest() to include an n() argument that would allow a user to return the latest n files.

Modification can be made to return_latest_local() by replacing the filter call with a slice call. Chunk below for reference.

        f <- f %>% file.info() %>% tibble::rownames_to_column(var = "filepath") %>% 
            dplyr::filter(mtime == max(mtime)) %>% dplyr::pull(filepath)
    }