Add a trailing backlash to a file path if this is a directory. This is useful in messages to the console for example to quickly identify directories from files.
mark_dirs(x)If x is a vector of relative paths, directory test is done with path
relative to the current working dir. Use in_dir() or use absolute
paths.
mark_dirs(list.files(find.package("xfun"), full.names = TRUE))
#> [1] "/tmp/RtmpP8B2Lv/temp_libpath4c005765d6ff4/xfun/DESCRIPTION"
#> [2] "/tmp/RtmpP8B2Lv/temp_libpath4c005765d6ff4/xfun/INDEX"
#> [3] "/tmp/RtmpP8B2Lv/temp_libpath4c005765d6ff4/xfun/LICENSE"
#> [4] "/tmp/RtmpP8B2Lv/temp_libpath4c005765d6ff4/xfun/Meta/"
#> [5] "/tmp/RtmpP8B2Lv/temp_libpath4c005765d6ff4/xfun/NAMESPACE"
#> [6] "/tmp/RtmpP8B2Lv/temp_libpath4c005765d6ff4/xfun/NEWS.Rd"
#> [7] "/tmp/RtmpP8B2Lv/temp_libpath4c005765d6ff4/xfun/NEWS.md"
#> [8] "/tmp/RtmpP8B2Lv/temp_libpath4c005765d6ff4/xfun/R/"
#> [9] "/tmp/RtmpP8B2Lv/temp_libpath4c005765d6ff4/xfun/help/"
#> [10] "/tmp/RtmpP8B2Lv/temp_libpath4c005765d6ff4/xfun/html/"
#> [11] "/tmp/RtmpP8B2Lv/temp_libpath4c005765d6ff4/xfun/libs/"
#> [12] "/tmp/RtmpP8B2Lv/temp_libpath4c005765d6ff4/xfun/resources/"
#> [13] "/tmp/RtmpP8B2Lv/temp_libpath4c005765d6ff4/xfun/scripts/"