getpadi(TSpadi)
getpadi()所属R语言包:TSpadi
Get Data from TSPADI Database Interface
从TSPADI数据库接口获取数据
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Get data from a TSPADI database interface.
获取数据从TSPADI数据库接口。
用法----------Usage----------
getpadi(series, server=PADIserver(), dbname="",
start.server=TRUE, server.process=PADIserverProcess(),
cleanup.script=PADIcleanupScript(),
starty=0,startm=0,startd=1, endy=0,endm=0,endd=1,
nobs=0,max.obs=2000, transformations=NULL, pad=FALSE,
user=Sys.info()[["user"]], passwd="",
stop.on.error=TRUE, use.tframe=FALSE, warn=TRUE, timeout=60,
names=series)
## Default S3 method:
getpadi(series, server=PADIserver(), dbname="",
start.server=TRUE, server.process=PADIserverProcess(),
cleanup.script=PADIcleanupScript(),
starty=0,startm=0,startd=1, endy=0,endm=0,endd=1,
nobs=0,max.obs=2000, transformations=NULL, pad=FALSE,
user=Sys.info()[["user"]], passwd="",
stop.on.error=TRUE, use.tframe=FALSE, warn=TRUE, timeout=60,
names=series)
参数----------Arguments----------
参数:series
A character string giving the database identifiers of the series. Alternately, series can be a vector of character strings specifying multiple series.
一个字符的字符串,给出了该系列的数据库标识符。另外,系列可以是一个矢量的字符串指定多个系列。
参数:server
A character string giving the network name of the server which is to be requested to supply the series. If series specifies multiple series and they are not all on the same server then server should be a vector of character strings with elements corresponding to the elements of series.
提供的网络名称被要求提供一系列的服务,这也是一个字符串。如果系列指定多个系列,它们并不全都相同的服务器上,那么服务器应该是一个的矢量系列的元素的元素对应的字符串。
参数:dbname
A character string giving additional information to the server about the location of the series (eg. the name of a database). If series specifies multiple series and they are not all on the same database then dbname should be a vector of character strings with elements corresponding to the elements of series.
的一个字符串,该系列的位置(例如,一个数据库的名称)提供额外的信息到服务器。如果系列指定了多个系列,他们是不是所有的在同一个数据库,那么数据库名应该是一个向量对应的元素系列元素的字符串。
参数:starty
An integer indicating the starting year.
一个整数,指示的起始年。
参数:startm
An integer indicating the starting period.
一个整数,指示的开始时间。
参数:startd
An integer indicating the starting day.
一个整数,指示开始的第一天。
参数:endy
An integer indicating the ending year.
一个整数,指示结束的一年。
参数:endm
An integer indicating the ending period.
一个整数,指示结束时间。
参数:endd
An integer indicating the ending day.
一个整数,指示结束的一天。
参数:nobs
The number of observations.
的若干意见。
参数:max.obs
integer indicating the possible returned data size used to define the size of the buffer to prepare.
整数,指示用于定义的大小的缓冲液,制备可能返回的数据大小。
参数:transformations
A character string giving transformations to be applied to the series (e.g. "log"). If multiple series are being requested then transformations can be a single string, in which case it is applied to all series, or a vector of character strings, one for each series. If no transformation is to be applied to some series then "" should be used.
一个字符串被应用到系列(如“log”)的转换。如果有多个系列,被要求转换可以是一个字符串,在这种情况下,它是适用于所有系列,或一个字符串向量,每个系列之一。如果没有转换为要施加到某些系列然后“应该被使用。
参数:pad
If FALSE (default) then all series are truncated to the interection of available time periods (i.e. the latest start date and earliest end date). If TRUE then series are padded with NA so the result starts at the earliest available observation and ends at the last available observation.
如果为FALSE(默认值),那么所有被截断的interection的可用时间段(即最新的开始日期和最早结束日期)。如果为真则NA系列填充,所以在最早的可观察的结果开始和结束的最后一个可用的观察。
参数:start.server
try to start a server if one is not running
尝试启动服务器,如果没有运行
参数:server.process
command to execute in an attempt to start a server
在尝试启动一个服务器要执行的命令
参数:cleanup.script
command to execute to terminate a server if one is started
要执行的命令终止服务器,如果一开始
参数:user
user id for access to the database (if necessary)
访问数据库的用户ID(如果有必要)
参数:passwd
password for access to the database (if necessary)
对数据库的访问的密码(如果有必要)
参数:stop.on.error
If TRUE then stop is executed when an error occurs. Otherwise, the error message is returned and the calling program must deal with it.
如果为真则停止执行时发生错误。否则,将返回错误消息和调用程序必须处理它。
参数:use.tframe
If use.tframe=FALSE then ts() is used to construct the time series, otherwise the tframe utilities are used. Certain transformations available with DSE require the tframe stucture and an error may result if these transformations are attempted with use.tframe=FALSE.
如果use.tframe = FALSE,则日ts()被使用构造时间系列,否则TFRAME的的实用程序使用。某些转换与DSE需要的TFRAME的的建筑物架构,可能会导致错误,如果这些尝试转换与use.tframe = FALSE。
参数:warn
Print warning messages for some crude frequency conversions (weekly data).
一些粗略的频率转换(周数据),打印警告消息。
参数:timeout
an integer indicating the number of seconds to wait before concluding that the server is not available.
一个整数,表示等待的秒数结束前的服务器不可用。
参数:names
Optional character vector to use for series names (set to identifieres by default).
使用可选的字符向量系列名称(设置到identifieres,默认情况下)。
Details
详细信息----------Details----------
The function getpadi retrieves data from a (time series) server. The padi code is also available (including the PADI server side) at http://tsdbi.r-forge.r-project.org/.
函数getpadi从一个(时间序列)的服务器中检索数据。 PADI的代码也可以在http://tsdbi.r-forge.r-project.org/(包括PADI服务器端)。
(This documentation could use some cleaning up, but first I am really hoping to convert the whole interface to a more modern, non-RPC based, mechanism.)
(这些文件可以使用一些清理,但第一,我真的希望整个界面转换到一个更现代的,非基于RPC的,机制)。
start. and end dates or start dates and nobs can be supplied. If all are set to zero (the default) then all data is retrieved, provided max.obs is large enough. If more than one series is to be returned then series should be a vector of strings. In this case dbname must be a vector of corresponding length or a single string which is applied to all series. All series must have the same frequency. If the number of observations in any single series is larger than max.obs then an error will occur and max.obs should be set larger. For many data frequencies startd and endd can be omitted.
启动。日期和结束日期,开始日期和NOBS可以提供。如果都设置为0(默认),那么所有的数据被检索,提供max.obs是足够大的。如果要返回多个系列,系列应该是一个字符串矢量。在这种情况下的dbname必须是相应的长度或一个单一的字符串被施加到所有系列的向量。所有系列必须具有相同的频率。如果在任何单一系列的若干意见大于max.obs的错误发生和max.obs应设置得更大。对于许多数据的频率startd和endd可以省略。
If start.server is FALSE then there will be no attempt to start a server and the function will stop if a server is not running. If start.server is TRUE (the default) then if server==PADIserver() (the default) and a server is not already running, there will be an attempt to start a server using the argument server.process. The default is determined by PADIserverProcess()
如果start.server是假的,那么将不会有尝试启动服务器,如果服务器没有运行,该功能将停止。如果是TRUE start.server(默认值),然后如果服务器== PADIserver()(默认)和服务器尚未运行,将尝试启动的服务器使用的参数server.process。默认情况下决定的PADIserverProcess()
The argument server.process is only used if it is necessary to start a server.
参数server.process仅用于如果有必要启动服务器。
If specified, server would typically be a single string, though there is some attempt to handle vectors of strings (indicating different servers for each series).
如果指定的话,服务器通常是一个字符串,尽管有一些处理字符串向量(表示每个系列的不同的服务器上)。
The string dbname is passed to the server, but it may or may not be used, depending on the server implementation. If the server is being started then it will run in the Unix pwd and local path names should work, BUT in general there is no guarantee that the server is running in the pwd and complete path names may be required.
的字符串的dbname被传递到服务器上,但它可能会或可能不会被使用,这取决于在服务器上执行。如果服务器正在启动,然后它会运行在Unix密码的本地路径名称应,但总体上是没有保证的服务器正在运行中的pwd和完整路径名可能需要。
Start and end dates or start dates and nobs can be supplied. If all are set to zero (the default) then all data is retrieved, provided max.obs is large enough.
开始日期和结束日期,开始日期和NOBS可以提供。如果都设置为0(默认),那么所有的数据被检索,提供max.obs是足够大的。
If the starting date and ending date and number of observations is set to zero, it will return the whole series. If the starting and ending dates are zero but number of observations is set, the LAST numobs observations are returned. If the starting date is sent, ending date is zero and numobs is non-zero, the FIRST numobs starting from start date are returned.
如果开始日期和结束日期和数量的观测值被设置为0,它会返回全系列。如果在起始和结束日期是零,但观测数目的设定,的LAST numobs意见返回。如果发送开始日期,结束日期是零,和numobs是非零的,从起始日期开始的FIRST numobs返回。
The size of the data array passed to C is the larger of nobs and max.obs. A ts matrix is returned. If more than one series is to be returned then series should be a vector of strings. In this case server must be a vector of corresponding length or a single string which is applied to all series. All series must have the same frequency and the time window is the intersection of the window for each series (i.e. the latest start and earliest end date). startd and endd provide for a tag (day).
传递给C的数据数组的大小是较大诺布斯和max.obs的。返回的TS矩阵。如果要返回多个系列,系列应该是一个字符串矢量。在这种情况下,服务器必须是相应的长度或一个单一的字符串被施加到所有系列的向量。所有系列必须具有相同的频率和时间窗口是窗口为每个系列的交叉点(即最新的开始和最早结束日期)。 startd和endd一个标记(天)。
If the starting date and ending date and number of observations is set to zero, it will return the whole series. If the starting and ending dates are zero but number of observations is set, the LAST numobs observations are returned. If the starting date is sent, ending date is zero and numobs is non-zero, the FIRST numobs starting from start date are returned.
如果开始日期和结束日期和数量的观测值被设置为0,它会返回全系列。如果在起始和结束日期是零,但观测数目的设定,的LAST numobs意见返回。如果发送开始日期,结束日期是零,和numobs是非零的,从起始日期开始的FIRST numobs返回。
If transformations is not null it should be a vector of strings, one for each series (with "" for any series which is not to be transformed), or a single string which is applied to each series. The transformations are applied by eval(call(transformations[i], .).
如果转换是不为空的,它应该是一个字符串vector,一个用于每个系列(包含“”这是不以被转化为任何系列),或者被施加到每一个系列的一个单一的字符串。应用转换的eval(检测:(转换[I]。)。
If use.tframe=FALSE then ts() is used to construct the time series, otherwise the tframe approach is used. (See the tframe package.) Certain transformations available with DSE require the tframe structure and an error may result if these transformations are attempted with use.tframe=FALSE.
如果use.tframe = FALSE,则日ts()被使用构造时间系列,否则TFRAME的的方法使用。 (见TFRAME包)。某些变革与DSE需要的TFRAME的的结构和错误可能会导致这些转换的尝试与use.tframe = FALSE。
If stop.on.error is TRUE then stop is executed if a data retrieval error occurs. If stop.on.error is FALSE then the error message is returned, which means the calling function will need to handle the error.
如果stop.on.error是TRUE,则停止执行,如果数据检索错误的发生。如果stop.on.error是FALSE,则返回错误消息,这意味着调用函数将需要处理的错误。
If warn is TRUE then warnings are issued for certain data conversions (weekly data) which may not work in all case. If warn is these warnings are not issued. timeout is the period to wait (in seconds) before generating an error.
如果警告是TRUE,则发出警告某些数据转换(周数据),在所有情况下可能无法正常工作。如果警告,这些警告没有发出。超时是产生错误之前的等待期间(以秒为单位)。
值----------Value----------
A time series matrix with a column for each series.
一列矩阵,每个系列的时间序列。
参见----------See Also----------
checkPADIserver, TSget, putpadi
checkPADIserver,TSget,putpadi
实例----------Examples----------
if(checkPADIserver("ets")){
cpi <-getpadi("P100000", server= "ets")# June 1992=100[1992年6月= 100]
cpi <-getpadi("P100000", starty=1988, startm=1,endy=1990, endm=12, server= "ets")
cpi <-getpadi( "P100000",starty=1988, startm=1,nobs=8, server= "ets")
data <- getpadi( c("V122491","V37124","P100000"), server= "ets" )
cpi <-getpadi("P100000", server= "ets", use.tframe=TRUE)
data <- getpadi( c("V122491","V37124","P100000"), server= "ets", use.tframe=TRUE)
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|