file_checks: File Extension Checks

Description Usage Arguments Value Note Examples

Description

Check whether file extension is as specified

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17

Arguments

x

file(s) to be tested

ext

extension to test against

Value

a logical value

Note

These only check the file extension and not the contents of the file. Checking the contents of a file might come later but would be quite a bit more involved. You can use readr or readxl (for example) to check the file contents.

Examples

1
2
3
4
5
# create your own file extension checks
is_word_file <- function(x){
  check_ext_against(x, ext = c("doc", "docx"))
}
is_word_file(c("blah.doc", "blah.docx", "blah.txt"))

roperators documentation built on Feb. 10, 2022, 1:07 a.m.