file_checks | R Documentation |
Check whether file extension is as specified
is_txt_file(x)
is_csv_file(x)
is_excel_file(x)
is_r_file(x)
is_rdata_file(x)
is_rda_file(x)
is_rds_file(x)
is_spss_file(x)
check_ext_against(x, ext = "txt")
x |
file(s) to be tested |
ext |
extension to test against |
a logical value
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.
# 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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.