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

rstudio-editors

Retrieve Information about an RStudio Editor


Description

Returns information about an RStudio editor.

Usage

getActiveDocumentContext()

getSourceEditorContext()

getConsoleEditorContext()

Details

The selection field returned is a list of document selection objects. A document selection is just a pairing of a document range, and the text within that range.

Value

A list with elements:

id The document ID.
path The path to the document on disk.
contents The contents of the document.
selection A list of selections. See Details for more information.

Note

The getActiveDocumentContext function was added with version 0.99.796 of RStudio, while the getSourceEditorContext and the getConsoleEditorContext functions were added with version 0.99.1111.


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.