TSget(TSdbi)
TSget()所属R语言包:TSdbi
Get Time Series Data Using a Database Connection
时间序列数据,使用一个数据库连接
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Get time series matrix structure from a database
从数据库中获取时间系列矩阵结构
用法----------Usage----------
TSget(serIDs, con=getOption("TSconnection"), ...)
## S4 method for signature 'character,missing'
TSget(serIDs, con=getOption("TSconnection"), ...)
## S4 method for signature 'character,ANY'
TSget(serIDs, con=getOption("TSconnection"), ...)
参数----------Arguments----------
参数:con
A database connection.
一个数据库连接。
参数:serIDs
identifiers for series to extract.
提取标识符系列。
参数:...
Arguments passed to TSgetSQL or other methods. See details.
参数传递给TSgetSQL或其他的方法。查看详细信息。
Details
详细信息----------Details----------
These functions extract data from a database using a connection. This method is generic. The argument serIDs should give identifiers for the series to extract.
这些功能中提取数据从一个数据库中使用一个连接。这种方法是通用的。参数serIDs应标识符系列中提取。
TSget and other functions also provide a way to query a regularly used database by setting the connection in options using options(TSconnection=con), so then only the series identifiers need to be specified in calls to TSget.
TSget等功能也提供了一种方法来查询经常使用的数据库,通过设置连接options使用options(TSconnection=con),这样的话只有的系列标识符的需要被指定在调用TSget。
The user can specify a default time series representation with the argument TSrepresentation="something" where "something" is "default" by default, but might be "zoo" or something else which is used to coerce the representation. The TSrepresentation is passed in the ... argument. The conversion is done with the function changeTSrepresentation. If the representation is a character string then it is applied using do.call(TSrepresentation, list(mat, dates)) where mat is the time series (matrix) to be return and dates are determined by as.Date(time(x)) where x is the default representation of the data. If representation is not a character string then it should be a function and is applied using TSrepresentation(mat, dates)
用户可以指定一个默认的时间序列表示的参数TSrepresentation =“东西”,“东西”,是“默认”的默认,但可能是“动物园”或别的东西,它是用来强迫的代表性。 TSrepresentation是通过在...的说法。转换完成后的功能changeTSrepresentation。如果表示是一个字符串,那么它是采用do.call(TSrepresentation, list(mat, dates))mat是时间序列(矩阵)返回日期是由as.Date(time(x))x是默认表示的数据。如果表示是不是字符串,那么它应该是一个函数,并采用TSrepresentation(mat, dates)
If TSrepresentation is not specified, or is specified as "default", then for SQL packages (TSMySQL, TSPostgreSQL , TSSQLite, etc) the ts representation is used for data from tables "A", "Q", "M","S" and zoo otherwise. See TSput for a list of the various tables. For other packages the default is zoo in most cases, but may vary.
如果TSrepresentation不指定或指定为“默认”,然后SQL程序包(TSMySQL,TSPostgreSQL ,TSSQLite,等)ts用于从表中的数据“A”,“Q”,“M”,“S”和zoo另有表示。 TSput的各种表的列表。对于其他包默认是动物园在大多数情况下,但可能会有所不同。
It would be possible to specify TSrepresentation="as.zoo", but this may result in as.zoo being applied twice, in which case some information abut the time representation gets lost, so the best way to get a zoo represenation is to specify TSrepresentation="zoo".
这将有可能指定TSrepresentation="as.zoo",但是这可能会导致在as.zoo被应用了两次,在这种情况下,毗连的时间表示会丢失一些信息,所以最好的方式来获得一个zoo represenation是指定TSrepresentation="zoo"。
Users can set a session default with options(TSrepresentation="something") so that this is always passed as an argument to TSget.
用户可以设置会话默认情况下options(TSrepresentation="something"),这是始终通过作为参数,TSget。
It is also possible to pass start, end, or tframe information to truncate the returned series. This is part of the ... argument passed to tfwindow. See tfwindow for more details. By default no truncation is applied.
另外,也可以通过开始,结束,信息或TFRAME信息截断返回的系列。这是一部分......参数传递到tfwindow。见tfwindow更多详情。默认情况下没有截断。
If the database supports vintages or panels then it is also possible to set defaults for these with, for example, options(TSvintage="current") and options(TSpanel="Canada"). The default specification has to be supported by the database for this to work.
如果数据库支持的年份或面板,那么它也可以设置这些有默认值,例如,options(TSvintage="current")和options(TSpanel="Canada")。默认的规则由数据库来支持这个工作。
Also, if the database supports vintages or panels it is possible to give a vector value for one of vintage or panel as long as serIDs is length 1. (That is, only one of serIDs, vintage or panel can have more than one element.) In this case, if names is not specified, vintage or panel will be used for the series names in the returned time series matrix.
另外,如果数据库支持的年份或面板,它有可能给的矢量值vintage或panel只要serIDs长度1。 (也就是说,只有一个serIDs,vintage或panel可以有一个以上的元素)。在这种情况下,如果names未指定,vintage 或panel将用于在返回的时间系列矩阵系列名称。
names, TSdescription, TSdoc andTSlabel can also be specified as arguments. (Passed in ...). See TSputSQL for more details.
names,TSdescription,TSdoc和TSlabel也可以被指定为参数。 (通过)。见TSputSQL更多详情。
值----------Value----------
A time series matrix.
时间序列矩阵。
参见----------See Also----------
TSdbi-package, TSconnect, TSput, TSdates tfwindow changeTSrepresentation
TSdbi-package,TSconnect,TSput,TSdatestfwindowchangeTSrepresentation
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|