as.xts.methods(xts)
as.xts.methods()所属R语言包:xts
Convert Object To And From Class xts
将对象转换为从阶级XTS
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Conversion S3 methods to coerce data objects of arbitrary classes to class xts and back, without losing any attributes of the original format.
S3的方法来强迫转换数据对象任意类的类xts和背部,而不会失去任何属性的原始格式。
用法----------Usage----------
## S3 method for class 'xts'
as.xts(x,...,.RECLASS=FALSE)
## S3 method for class 'timeSeries'
as.xts(x, dateFormat="POSIXct", FinCenter, recordIDs,
title, documentation, ..., .RECLASS=FALSE)
## S3 method for class 'its'
as.xts(x,...,.RECLASS=FALSE)
## S3 method for class 'zoo'
as.xts(x, order.by=index(x), frequency=NULL, ..., .RECLASS=FALSE)
## S3 method for class 'ts'
as.xts(x, dateFormat,...,.RECLASS=FALSE)
## S3 method for class 'data.frame'
as.xts(x, order.by, dateFormat="POSIXct",
frequency=NULL, ...,.RECLASS=FALSE)
## S3 method for class 'matrix'
as.xts(x, order.by, dateFormat="POSIXct",
frequency=NULL, ..., .RECLASS=FALSE)
as.fts.xts(x)
参数----------Arguments----------
参数:x
data object to convert. See details for supported types
数据对象的转换。详情请参阅支持的类型
参数:dateFormat
what format should the dates be converted to
什么样的格式转换为日期
参数:FinCenter
see timeSeries help
时间序列帮助
参数:recordIDs
see timeSeries help
时间序列帮助
参数:title
see timeSeries help
时间序列帮助
参数:documentation
see timeSeries help
时间序列帮助
参数:order.by
see zoo help
看到动物园的帮助
参数:frequency
see zoo help
看到动物园的帮助
参数:...
additional parameters or attributes
额外的参数或属性
参数:.RECLASS
should conversion be reversible?
应该转换是可逆的吗?
Details
详细信息----------Details----------
A simple and reliable way to convert many different objects into a uniform format for use within R.
一个简单而可靠的方法来许多不同的对象转换成统一的格式内使用R.
It is possible with a call to as.xts to convert objects of class timeSeries, ts, its, matrix, data.frame, and zoo.
它可以调用as.xts类的对象转换timeSeries,ts,its,matrix,data.frame和zoo。
Additional name=value pairs may be passed to the function to be added to the new object. A special print.xts method will assure that the attributes are hidden from view, but will be available via R's standard attr function.
其他名称=值对可传递的功能被添加到新的对象。一个特殊的print.xts方法将确保从视图中隐藏的属性,但可以通过R的标准attr函数。
If .RECLASS=TRUE, the returned object will preserve all relevant attribute/slot data within itself, allowing for temporary conversion to use zoo and xts compatible methods. A call to reclass returns the object to its original class, with all original attributes intact - unless otherwise changed. This is the default behavior when try.xts is used for conversion, and should not be altered by the user; i.e. don't touch it unless you are aware of the consequences.
如果RECLASS = TRUE,返回的对象将保留所有相关的属性/插槽内本身,允许临时使用转换动物园和XTS兼容的方法。的调用reclass返回到原来的类的对象,所有原始属性不变的 - 除非另有改变。这是默认的行为,当try.xts是用于转换,不应该由用户修改,即不要去碰它,除非你是知道的后果。
It should be obvious, but any attributes added via the ... argument will not be carried back to the original data object, as there would be no available storage slot/attribute.
这应该是显而易见的,但通过增加任何属性...参数不会回到原来的数据对象,因为没有可用的存储插槽/属性。
值----------Value----------
An S3 object of class xts.
一个S3对象的类xts。
(作者)----------Author(s)----------
Jeffrey A. Ryan
参见----------See Also----------
xts
xts
实例----------Examples----------
## Not run: [#不运行:]
# timeSeries[时间序列]
library(timeSeries)
x <- timeSeries(1:10, 1:10)
str( as.xts(x) )
str( reclass(as.xts(x)) )
str( try.xts(x) )
str( reclass(try.xts(x)) )
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|