qrepl: A Qt based REPL emulator

Description Usage Arguments Details Value Author(s)

View source: R/repl.R

Description

Creates a Qt Widget that emulates the R REPL.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
qrepl(env = .GlobalEnv, ...,
      family = "monospace", pointsize = 12,
      incolor = "red", outcolor = "blue", msgcolor = "black",
      html.preferred = FALSE, history = TRUE,
      title)

qreplu(env = .GlobalEnv,
       ...,
       history = TRUE,
       eval.on.newline = TRUE,
       incolor = "red",
       outcolor = "blue",
       msgcolor = "black")

Arguments

env

The evaluation environment for the REPL.

...

Further arguments, passed on to RCodeEditor.

family

Font family to be used.

pointsize

Font pointsize to be used.

incolor

The color used for code that is evaluated.

outcolor

The color used for output.

msgcolor

The color used for messages.

html.preferred

Logical flag indicating whether HTML output is preferred (for table-like objects).

history

Logical flag indicating whether command history should be available. If enabled, pressing Ctrl+Up or Down arrows allow navigation through previous commands. History is currently not retained across invocations.

title

Character string giving window title.

eval.on.newline

Logical flag indicating whether execution should be attempted whenever Enter is pressed. Otherwise execution must be explicitly triggered, e.g., by pressing the Ctrl+Enter shortcut.

Details

This widget tries to emulate the behaviour of the R command-line interface (Read-Eval-Print-Loop) in a GUI. The current implementation is essentially a proof-of-concept, and not meant for serious use.

Two versions are available. qreplu emulates the conventional REPL interface where commands are typed at a command prompt and evaluated when Enter is pressed (except that parse errors are trapped and not evaluated). qrepl provides an alternative interface with two command specification modes and a common output area. Commands can be entered either in input mode, where one or more commands may be typed and then executed using Ctrl+Enter, or in edit mode, where commands are typed in a file, and selections may be executed similarly. The latter mode is intended to facilitate the recommended method of working in ESS, where commands are entered and modified within an editor, and executed as necessary. When working in edit mode, commands executed are automatically added to the editor area, keeping a record of those commands.

All code editing interfaces support command completion and code indentation (but the rules are not yet customizable).

Value

A QWidget instance.

Author(s)

Deepayan Sarkar


qtutils documentation built on May 29, 2017, 5:54 p.m.

Related to qrepl in qtutils...