printWithNumbers: Print a function with line numbers

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/debug.R

Description

A function to print a function together with relevant line numbers. These can be used to decide where to set trace functions etc.

Usage

1

Arguments

f

Any R function.

Details

The function is printed, all lines that correspond to potential break points in the code are numbered.

Value

The function is invoked primarily for its side effect; the printing of the function with line numbers. However, the character vector is returned and could be used as input for other tools.

Author(s)

R. Gentleman

See Also

trace, capture.output

Examples

1

Example output

Loading required package: graph
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

function (from, to) 
1:{
2:asSimpleVector(from, mode(to))
}

RBioinf documentation built on Nov. 8, 2020, 11:11 p.m.