Learn R Programming

covtracer (version 0.0.2)

as.data.frame.list_of_srcref: Coerce a list_of_srcref object to a data.frame

Description

Coerce a list_of_srcref object to a data.frame

Usage

# S3 method for list_of_srcref
as.data.frame(
  x,
  ...,
  use.names = TRUE,
  expand.srcref = FALSE,
  row.names = NULL
)

Value

A data.frame with one record per srcref and variables:

name

Names of the srcref objects, passed using the names of x if use.names = TRUE

srcref

srcref objects if expand.srcrefs = FALSE

srcfile, line1, byte1, line2, col1, col2, parsed1, parsed2

The srcref file location if it can be determined. If an absolute path can't be found, only the base file name provided in the srcref object and the numeric components of the srcref objects if expand.srcrefs = TRUE

Arguments

x

A list_of_srcref object

...

Additional arguments unused

use.names

A logical indicating whether the names of x should be used to create a name column.

expand.srcref

A logical indicating whether to expand the components of srcref objects into separate columns.

row.names

NULL or a single integer or character string specifying a column to be used as row names, or a character or integer vector giving the row names for the data frame.

Examples

Run this code
pkg <- system.file("examplepkg", package = "covtracer")
install.packages(
  pkg,
  type = "source",
  repos = NULL,
  quiet = TRUE,
  INSTALL_opts = "--with-keep.source"
)
as.data.frame(pkg_srcrefs("examplepkg"))

Run the code above in your browser using DataLab