localServerStart: Function to interact with local web server

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/LocalVersion.R

Description

The gWidgetsWWW package allows gWidgets scripts to be run through a web browser. For wider deployment, the package can be run through the RApache package. To develop scripts and to run scripts standalone, the local server may be used.

The package uses R's dynamic help web server for the local server. The main functions are localServerStart, localServerOpen and localServerSource.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11

Arguments

file

Name of file to open. If no package is specified, this is a file relative to the directory returned by getwd. If the package argument is given, then the file is found from the call system.file(file, package=package).

package

If specified, files are found reltive to this package through system.file(file,package=package).

file\_or\_url

A file or url to source in to create the web page.

port

Deprected

...

passed to constructor

Details

The calls localServerOpen and localServerSource will start the help system web server if it isn't already started.

Use localServerSource to download a file from a website to run. This allows one to distribute scripts quite easily.

There is no way to send information to the browser from the R console. The browser must initiate the request.

The local server logs error messages in the console.

The functions localServerStop and localServerRestart are deprected.

Value

For localServerStart, localServerOpen and localServerSource a new browser page is opened.

Author(s)

John Verzani

References

The dynamic help system is well described by Duncan Murdoch and Simon Urbanek here in "The New R Help System." The R Journal, 1(2):60-65, December 2009. The use of a custom handler was derived by work of Romain Francois's highlight package http://romainfrancois.blog.free.fr/.

See Also

Rpad where this idea originated.

Examples

1
2
3
4
5
	## Not run: 
	localServerStart()	# opens browser with files in working directory
	localServerOpen(file="Examples/ex-index.R", package="gWidgetsWWW")
	
## End(Not run)

gWidgetsWWW documentation built on May 2, 2019, 4:47 p.m.