as.xts(xts)
as.xts()所属R语言包:xts
Convert Object To And From Class xts
将对象转换为从阶级XTS
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Conversion functions to coerce data objects of arbitrary classes to class xts and back, without losing any attributes of the original format.
转换函数来强制数据对象任意类的类xts和背部,而不会失去任何属性的原始格式。
用法----------Usage----------
as.xts(x, ...)
xtsible(x)
Reclass(x)
try.xts(x, ..., error = TRUE)
reclass(x, match.to, error = FALSE, ...)
参数----------Arguments----------
参数:x
data object to convert. See details for supported types
数据对象的转换。详情请参阅支持的类型
参数:match.to
xts object whose attributes will be passed to x
xts对象属性将被传递给x
参数:error
error handling option. See Details.
错误处理选项。查看详细信息。
参数:...
additional parameters or attributes
额外的参数或属性
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, irts, fts, its, matrix, data.frame, and zoo.
它可以调用as.xts转换类的对象timeSeries,ts,irts,fts,its,<X >,matrix和data.frame。
xtsible safely checks whether an object can be converted to an xts object; returning TRUE on success and FALSE otherwise.
xtsible安全检查一个对象是否可以被转换成一个xts对象,成功返回TRUE,否则返回FALSE。
The help file as.xts.methods lists all available xts methods and arguments specific to each coercible type.
帮助文件as.xts.methods XTS列出所有可用的方法和参数,具体到每一个强制转换类型。
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, as well as the xtsAttributes function.
其他名称=值对可传递的功能被添加到新的对象。一个特殊的print.xts方法将确保从视图中隐藏的属性,但可以通过R的标准attr功能,以及xtsAttributes功能。
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.
返回的对象将保留所有相关的属性/插槽内,允许临时使用转换动物园和XTS兼容的方法。的调用reclass返回到原来的类的对象,所有原始属性不变的 - 除非另有改变。
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.
这应该是显而易见的,但通过增加任何属性...参数不会回到原来的数据对象,因为没有可用的存储插槽/属性。
Reclass is designed for top-level use, where it is desirable to have the object returned from an arbitrary function in the same class as the object passed in. Most functions within R are not designed to return objects matching the original object's class. While this tool is highly experimental at present, it attempts to handle conversion and reconversion transparently. The caveats are that the original object must be coercible to xts, the returned object must be of the same row length as the original object, and that the object to reconvert to is the first argument to the function being wrapped.
Reclass是专为顶级的使用,它是需要在同一类中的任意函数返回的对象的对象传递进来的大部分功能在R不返回匹配对象的原始对象的类。目前,虽然这个工具是高度实验性的,它会尝试透明处理转换和恢复原状。注意事项是,原来的对象必须可以转换成xts,返回的对象必须是同一行的长度与原始对象,并且把刚才的对象是被包装的函数的第一个参数。
try.xts and reclass are functions that enable external developers access to the reclassing tools within xts to help speed development of time-aware functions, as well as provide a more robust and seemless end-user experience, regardless of the end-user's choice of data-classes.
try.xts和reclass功能,使外部开发人员可以访问内reclassing工具xts帮助高速发展的的时间感知功能,以及提供一个更强大的,无缝的最终用户经验,无论最终用户的选择的数据类。
The error argument to try.xts accepts a logical value, indicating where an error should be thrown, a character string allowing for custom error messages to be displayed, or a function of the form f(x, ...), to be called upon construction error.
error参数try.xts接受一个逻辑值,指明应该抛出一个错误,允许自定义错误消息将显示一个字符串,或一个函数的形式f(x, ...),是呼吁施工误差。
See the accompanying vignette for more details on the above usage and the package in general.
上述使用和包的详细信息,请参阅随附的小插曲。
值----------Value----------
An S3 object of class xts.
一个S3对象的类xts。
In the case of Reclass and reclass, the object returned will be of the original class as identified by CLASS.
在的情况下,Reclass和reclass,返回的对象将是原班所确定的CLASS。
(作者)----------Author(s)----------
Jeffrey A. Ryan
参见----------See Also----------
xts,as.xts.methods
xts,as.xts.methods
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|