summary.filesearch: Summarize File Searches

View source: R/search_files.R

summary.filesearchR Documentation

Summarize File Searches

Description

A custom summary function for objects returned by search_files.

Usage

## S3 method for class 'filesearch'
summary(object, ..., type = c("file", "what", "matches"))

Arguments

object

An object returned by search_files.

...

Needed for compatibility.

type

Type of summary.

Value

A summarized object.

See Also

Other searching functions: compare_vectors(), file_modified_last(), find_files(), fromto(), grep_file(), missing_docs, search_files(), search_rows()

Examples

write.csv(mtcars, file.path(tempdir(), "mtcars.csv"))
 for (i in 0:9) {
     write.csv(iris, file.path(tempdir(), paste0("iris", i, ".csv")))
 }
search_files(what = "Mazda", path = tempdir(), pattern = "^.*\\.csv$")
search_files(what = "[Ss]etosa", path = tempdir(), pattern = "^.*\\.csv$")
x <- search_files(path = tempdir(),
                  pattern = "^.*\\.csv$",
                  exclude = "[2-9]\\.csv$",
                  what = "[Ss]etosa")
summary(x)
summary(x, type = "what")
summary(x, type = "matches")
try(search_files(what = "ABC", path = tempdir(), pattern = "^.*\\.csv$"))

fritools documentation built on Nov. 19, 2023, 1:06 a.m.