This function is a slightly friendlier version of list.files
in that it automatically includes the full.names=TRUE
argument.
Examples
# list files in location where R is installed
listFiles(R.home())
#> [1] "/opt/R/4.4.1/lib/R/COPYING" "/opt/R/4.4.1/lib/R/SVN-REVISION"
#> [3] "/opt/R/4.4.1/lib/R/bin" "/opt/R/4.4.1/lib/R/doc"
#> [5] "/opt/R/4.4.1/lib/R/etc" "/opt/R/4.4.1/lib/R/include"
#> [7] "/opt/R/4.4.1/lib/R/lib" "/opt/R/4.4.1/lib/R/library"
#> [9] "/opt/R/4.4.1/lib/R/modules" "/opt/R/4.4.1/lib/R/share"
#> [11] "/opt/R/4.4.1/lib/R/site-library"
listFiles(R.home(), pattern='README')
#> character(0)