getSource: Get current source lines

Description Usage Arguments Value Examples

Description

Gets either the selected text, or up to len lines of text from the current cursor position in the RStudio editor.

Usage

1
getSource(len = 100)

Arguments

len

How many lines to get if none are selected.

Value

A character vector containing the text, with attribute named "start" holding the starting position of the section in the source editor.

Examples

1
2
if (rstudioapi::isAvailable())
  getSource()

dmurdoch/JSDocPlugin documentation built on May 20, 2019, 7:55 a.m.