FindReplace: Find/Replace text in a file

Description Usage Arguments Details Value Author(s) Examples

View source: R/FindReplace.R

Description

Simple wrapper functions to make it easier to replace the text in a file, possibly due to spelling errors, but perhaps to replace default text in a template file.

Usage

1
2
3
4
5

Arguments

file

The external (text) file or template to be updated.

find

The text to remove.

replace

The text to insert.

Details

The FindReplace function is purely intended for use on an external file whereas UseTemplate is intended to take a template file from within the BrailleR package and return the updated text to the calling environment.

Rnw2Rmd tries to replace Standard LaTeX commands and Sweave chunk headers with R markdown ones. It is NOT comprehensive, but it does get a long way towards a useful markdown file.

Obviously the specified file must exist for these functions to work.

Value

FindReplace will replace the existing file with the updated version while UseTemplate will return a character string which will usually be pushed out to an R script or R markdown file.

Author(s)

A. Jonathan R. Godfrey

Examples

1
2
UseTemplate("DTGroupSummary.R")
UseTemplate("DTGroupSummary.R", "DataName", "MyData")

BrailleR documentation built on Aug. 10, 2018, 5:04 p.m.