summary() produces a compact overview of a seekr_match vector:
the most frequent files, matched texts, file extensions, and encodings.
When replacements are staged, matched texts are displayed together with their
replacement preview, giving a high-level picture of what replace_files()
would change.
Arguments
- object
A
seekr_matchvector.- ...
Not used. Present for compatibility with the
summary()generic.- x
A
summary_seekr_matchobject, as returned bysummary.seekr_match().- n
Maximum number of rows to print in each summary table. If
NULL, a compact default is used. This limit is applied separately to each section of the summary, such as top files, top matches/replacements, top extensions, and top encodings.
Value
An object of class summary_seekr_match, containing summary tables for
files, matches/replacements, extensions, and encodings. Print it with
print() to display a formatted summary in the console.
See also
print.seekr_match()for a full match-level display with context lines.str.seekr_match()for the internal field structure.
Examples
ext_path <- system.file("extdata", package = "seekr")
x <- seekr("TODO", path = ext_path)
y <- seekr("TODO", "DONE", path = ext_path)
summary(x)
#> ── <seekr::match[1]> ───────────────────────────────────────────────────────────
#> Top source [1]
#> • /home/runner/work/_temp/Library/seekr/extdata/script2.R : 1 (100.0%)
#>
#> Top match [1]
#> • <TODO> : 1 (100.0%)
#>
#> Top extension [1]
#> • r : 1 (100.0%)
#>
#> Top encoding [1]
#> • UTF-8 : 1 (100.0%)
#>
summary(y)
#> ── <seekr::match[1]> ───────────────────────────────────────────────────────────
#> Top source [1]
#> • /home/runner/work/_temp/Library/seekr/extdata/script2.R : 1 (100.0%)
#>
#> Top match/replacement [1]
#> • <TODO/DONE> : 1 (100.0%)
#>
#> Top extension [1]
#> • r : 1 (100.0%)
#>
#> Top encoding [1]
#> • UTF-8 : 1 (100.0%)
#>
summary(c(x, y))
#> ── <seekr::match[2]> ───────────────────────────────────────────────────────────
#> Top source [1]
#> • /home/runner/work/_temp/Library/seekr/extdata/script2.R : 2 (100.0%)
#>
#> Top matches/replacements [2]
#> • <TODO/DONE> : 1 (50.0%)
#> • <TODO> : 1 (50.0%)
#>
#> Top extension [1]
#> • r : 2 (100.0%)
#>
#> Top encoding [1]
#> • UTF-8 : 2 (100.0%)
#>
