knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%",
  cache = FALSE
)

grepr

grepr aims to provide a similar functionality as the bash command grep and display the results as RStudio source markers

Installation

You can install the developent version of grepr from GitHub with:

remotes::install_github("GregorDeCillia/grepr")

Example

The function grepr can be used to find matches in files based on a regular expression.

library(grepr)
grepr("message")[5:9, ]

If grepr is called in RStudio, the results are displayed as RStudio source markers.

Arguments

Argument | Description -------------------|------------------------------------------------------------ pattern | a character string containing a regular expression dir | a directory from which the search is conducted. Defaults to the working directory. ignore_dotfiles| should hidden files be ignored? Defaults to TRUE file_pattern | a regular expression which can be used to exclude certain files from the search

Umlauts

grep_umlauts is a wrapper around grepr which looks for umlauts via the pattern argument. It can be used with a flag ignore_roxygen to skip Rd Files and roxygen comments.

Supported symbols: Ö, Ä, Ü, ö, ä, ü, ß

grep_umlauts(file_pattern = "README\\.Rmd")

The function print_substitution_table() can be used to suggest alternatives

print_substitution_table()

Class methods

Calls to grepr::grepr() create objects of the class grepr. Those objects can be used in the following ways.

grep_umlauts(file_pattern = "README\\.Rmd") %>% as.data.frame()

Known Issues

Possible improvements



GregorDeCillia/grepr documentation built on Oct. 30, 2019, 6:33 p.m.