Rhttpd-class(Rook)
Rhttpd-class()所属R语言包:Rook
Class Rhttpd
类Rhttpd
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Rhttpd is a convenience class for installing and running Rook applications. It hides the details of starting and stopping the server and adding and removing Rook applications from the server.
Rhttpd是一个方便的类鲁克应用程序的安装和运行。它隐藏的启动和停止服务器,添加和删除Rook应用程序从服务器的详细信息。
Users starts by creating one Rhttpd object, then adding applications to it, and then starting the server (see the section “Examples” for a typical session). There are no restrictions on creating more than one server object, but know that it only manages the applications that are added to it and not others.
用户启动通过创建一个Rhttpd对象,然后给它添加应用程序,然后启动服务器(请参阅“示例”一个典型的会议)。创建一个以上的服务器对象没有任何限制,但要知道,它只是管理的应用程序添加到它,而不是别人。
Applications can be added and removed regardless of whether or not the server is running. Stopping the server does not remove any applications. Adding an application with the same name as one already installed simply overwrites the one installed. If the server is started with no applications installed, it will install the application named RookTestApp located in:
无论是否服务器运行的是应用程序可以被添加和去除。停止服务器不删除任何应用程序。添加一个应用程序具有相同的名称作为一个已经安装简单,安装覆盖一个。如果启动服务器时没有安装的应用程序,它会安装的应用程序,名为RookTestApp位于:
system.file('exampleApps/RookTestApp.R',package='Rook').
system.file('exampleApps/RookTestApp.R',package='Rook')。
Also, see browseURL to learn how to get R to automatically launch your favorite web browser.
此外,browseURL学习如何得R自动启动您最喜爱的网页浏览器。
方法----------Methods----------
open(x) or browse(x): Calls browseURL on the installed Rook application designated by x. x is either an integer or a character string. See the output of print().
open(x)或browse(x):调用browseURL上安装的鲁克应用程序指定的x。 x是一个整数或一个字符串。见的输出print()。
print() or show(): Lists the installed Rook applications.
print()或show():列出已安装的鲁克的应用程序。
remove(app,all=FALSE): Removes the application known to the server. app can be an RhttpdApp object previously added, the name of the application as a character string, or an index as a numeric or integer value. See the output of print().
remove(app,all=FALSE):删除该应用程序到服务器。 appRhttpdApp对象以前添加的应用程序的名称作为一个字符串,或者作为一个数字或整数索引值。见的输出print()。
full_url(i): Returns the absolute url to the application for the given index.
full_url(i):返回的绝对URL的应用程序给定的索引。
start(listen='127.0.0.1', port=getOption('help.ports'), quiet=FALSE): Starts the server on the given listen address and port. listen is always character string. Note that if there are no applications added to the object prior to starting, then the RookTestApp located in system.file('exampleApps/RookTestApp.R',package='Rook') is automatically added.
start(listen='127.0.0.1', port=getOption('help.ports'), quiet=FALSE):启动服务器在给定的listen地址和port。 listen是字符串。请注意,如果没有应用程序开始之前,添加到对象,那么位于的RookTestAppsystem.file('exampleApps/RookTestApp.R',package='Rook')被自动添加。
new(): Create a new Rhttpd object.
new():创建一个新的Rhttpd对象。
launch(...): Combines the steps of starting the server, creating an RhttpdApp object, adding it to the server, and opening the app in the browser. ... argument is passed to RhttpdApp$new().
launch(...):将启动服务器的步骤,创建一个RhttpdApp对象,将它添加到服务器,并在浏览器中打开应用程序。 ...参数传递给RhttpdApp$new()。
debug(): Returns the integer value provided by getOption('Rhttpd_debug') or 0 if the option is NULL.
debug():getOption('Rhttpd_debug')或0,如果该选项是NULL返回整数值。
stop(): Stops the server.
stop():停止服务器。
add(app=NULL,name=NULL): Adds a new Rook application to the server. app can be an RhttpdApp object or any Rook application. name is a character string and is ignored if app is an RhttpdApp object.
add(app=NULL,name=NULL):添加一个新的Rook应用程序的服务器。 app可以是一个RhttpdApp对象或任何Rook应用。 name是一个字符串,并且被忽略app如果是RhttpdApp对象。
参见----------See Also----------
RhttpdApp
RhttpdApp
实例----------Examples----------
# Create an Rhttpd object and start the internal web server. Note that[创建一个Rhttpd,对象,并启动内部Web服务器。需要注意的是]
# if there are no applications added, then the default RookTest app in[如果有没有添加的应用程序,那么默认RookTest的应用程序中]
# system.file('exampleApps/RookTestApp.R',package='Rook') is automatically[。系统(exampleApps / RookTestApp.R,包=乌鸦)是自动]
# added.[补充说。]
s <- Rhttpd$new()
## Not run: [#不运行:]
s$start(quiet=TRUE)
s$browse(1)
## End(Not run)[#(不执行)]
s$print()
# Be sure to install the Hmisc package before installing and running[安装和运行之前,请务必到安装的Hmisc的包]
# this application. You will want to; it's a pretty good one.[此应用程序。你会想,这是一个相当不错的。]
# s$add([美元加(]
# app=system.file('exampleApps/Hmisc/config.R',package='Rook'),[应用程序。系统(exampleApps / Hmisc / config.R的“,包=乌鸦),]
# name='hmisc')[名称=hmisc“)]
s$add(
app=system.file('exampleApps/helloworld.R',package='Rook'),
name='hello'
)
s$add(
app=system.file('exampleApps/helloworldref.R',package='Rook'),
name='helloref'
)
s$add(
app=system.file('exampleApps/summary.R',package='Rook'),
name='summary'
)
s$print()
# Stops the server but doesn't uninstall the app[停止服务器,但不卸载的应用程序]
## Not run: [#不运行:]
s$stop()
## End(Not run)[#(不执行)]
s$remove(all=TRUE)
rm(s)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|