listExamples: listExamples lists all the examples in a package R file

View source: R/rutils.R

listExamplesR Documentation

listExamples lists all the examples in a package R file

Description

listExamples lists all the examples in a package R file. It comments out the first line number and any dontrun statements along with their following curly bracket.

Usage

listExamples(infile)

Arguments

infile
  • a character variable containing the path and filename

Value

Creates an R file in the working directory and prints its name to the console

Examples

## Not run: 
txt <- vector("character",4)
txt[1] <- "#' @examples "
txt[2] <- "#' /dontrun{"
txt[3] <- "#' print("This is an example of using listExamples")"
txt[4] <- "#' }"
infile <- textConnection(txt)
listExamples(infile)

## End(Not run)

haddonm/codeutils documentation built on April 15, 2024, 1:02 p.m.