Learn R Programming

gWidgets (version 0.0-25)

gcommandline: A command line interface

Description

This constructs a simple command line interface for R

Usage

gcommandline(command = "", assignto = NULL, useGUI = TRUE, useConsole = FALSE, prompt = getOption("prompt"), width = 500, height = 0.6 * width, container = NULL, ...,toolkit =
                 guiToolkit())

Arguments

Details

Additional commands can be added programmatically with the svalue<- method. The The value assigned is a string containing the command. If it has a names attribute, this is taken as the variable name to assign the output to.

The svalue method returns the command history.

The "[" method can be used to retrieve the command history as well.

Examples

Run this code
obj = gcommandline(container=TRUE)
  svalue(obj) <- "2+2"
  ## assign to x
  command = "rnorm(100)"; names(command) = "x"
  svalue(obj) <- command
  ## look at history
  obj[]

Run the code above in your browser using DataLab