Detect string in file

str_detect_in_file(file, pattern, only_comments = FALSE, collapse = FALSE)

Arguments

file

Path to file.

pattern

Pattern to match.

only_comments

default FALSE. Whether to only search in commented lines.

collapse

default: FALSE: search file line by line. If true, then pattern is search in the entire file at once after collapsing. (only_comments does not work when collapse is set to TRUE)

Value

Boolean whether pattern exists in file.