knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "140%" )
sifr is a tool for searching text strings and regular expression patterns recursively in directory trees from within R. It is mainly a convenience utility for interactive use.
sifr supports colored console
output, RStudio source markers, and can also return the search results as
a data.frame
for further processing. In addition, sifr provides
sed_replace()
on supported platforms (such as Linux, BSD, macOS) for replacing
regex patterns across directory trees via sed.
And the development version from GitHub with:
# install.packages("devtools") devtools::install_github("s-fleck/sifr")
library(sifr) tf <- tempfile(fileext = ".csv") write.csv(cars, tf) x <- sif("26", dir = dirname(tf), markers = FALSE, path_pattern = ".*\\.csv$") print(x) as.data.frame(x) sed_replace("26", "twentysix", dir = dirname(tf), path_pattern = ".*\\.csv$") sif("26", dir = dirname(tf), markers = FALSE, path_pattern = ".*\\.csv$") sif("twentysix", dir = dirname(tf), markers = FALSE, path_pattern = ".*\\.csv$") unlink(tf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.