Skip to contents

Returns names of files whose text contains a pattern

Usage

search_files(pattern, files, return.path = FALSE)

Arguments

pattern

Case sensitive pattern to look for

files

Text files to search (e.g., .R, .txt...)

return.path

Include full file name path? Logical. Default is FALSE

See also

readLines, grep

Examples

#files<-list.files(path="...",full.names=TRUE, recursive = TRUE)
#files<-files[grep('.R',files)]
#search_files('some text',files)