Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sourceMarkers

Display source markers


Description

Display user navigable source markers in a pane within RStudio.

Usage

sourceMarkers(
  name,
  markers,
  basePath = NULL,
  autoSelect = c("none", "first", "error")
)

Arguments

name

The name of marker set. If there is a market set with this name already being shown, those markers will be replaced.

markers

An R list, or data.frame, of source markers. See details for more details on the expected format.

basePath

Optional. If all source files are within a base path, then specifying that path here will result in file names being displayed as relative paths. Note that in this case markers still need to specify source file names as full paths.

autoSelect

Auto-select a marker after displaying the marker set?

Details

The markers argument can contains either a list of marker lists or a data frame with the appropriate marker columns. The fields in a marker are as follows (all are required):

type The marker type ("error", "warning", "info", "style", or "usage").
file The path to the associated source file.
line The line number for the associated marker.
column The column number for the associated marker.
message A message associated with the marker at this location.

Note that if the message field is of class "html" (i.e. inherits(message, "html") == TRUE) then its contents will be treated as HTML.

Note

The sourceMarkers function was added in version 0.99.225 of RStudio.


rstudioapi

Safely Access the RStudio API

v0.13
MIT + file LICENSE
Authors
Kevin Ushey [aut, cre], JJ Allaire [aut], Hadley Wickham [aut], Gary Ritchie [aut], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.