EVOLUTION-MANAGER
Edit File: as.xts.methods.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Convert Object To And From Class xts</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for as.xts.methods {xts}"><tr><td>as.xts.methods {xts}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Convert Object To And From Class xts </h2> <h3>Description</h3> <p>Conversion S3 methods to coerce data objects of arbitrary classes to class <code>xts</code> and back, without losing any attributes of the original format. </p> <h3>Usage</h3> <pre> ## 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 '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) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p> data object to convert. See details for supported types </p> </td></tr> <tr valign="top"><td><code>dateFormat</code></td> <td> <p>what format should the dates be converted to</p> </td></tr> <tr valign="top"><td><code>FinCenter</code></td> <td> <p>see timeSeries help</p> </td></tr> <tr valign="top"><td><code>recordIDs</code></td> <td> <p>see timeSeries help</p> </td></tr> <tr valign="top"><td><code>title</code></td> <td> <p>see timeSeries help</p> </td></tr> <tr valign="top"><td><code>documentation</code></td> <td> <p>see timeSeries help</p> </td></tr> <tr valign="top"><td><code>order.by</code></td> <td> <p>see <a href="../../zoo/html/zoo.html">zoo</a> help </p> </td></tr> <tr valign="top"><td><code>frequency</code></td> <td> <p>see <a href="../../zoo/html/zoo.html">zoo</a> help </p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p> additional parameters or attributes </p> </td></tr> <tr valign="top"><td><code>.RECLASS</code></td> <td> <p> should conversion be reversible? </p> </td></tr> </table> <h3>Details</h3> <p>A simple and reliable way to convert many different objects into a uniform format for use within <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>. </p> <p>It is possible with a call to <code>as.xts</code> to convert objects of class <code>timeSeries</code>, <code>ts</code>, <code>matrix</code>, <code>data.frame</code>, and <code>zoo</code>. </p> <p>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 <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>'s standard <code>attr</code> function. </p> <p>If <code>.RECLASS=TRUE</code>, 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 <code>reclass</code> returns the object to its original class, with all original attributes intact - unless otherwise changed. This is the default behavior when <code>try.xts</code> 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. </p> <p>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. </p> <h3>Value</h3> <p>An S3 object of class <code>xts</code>. </p> <h3>Author(s)</h3> <p> Jeffrey A. Ryan </p> <h3>See Also</h3> <p><code><a href="xts.html">xts</a></code>, <code><a href="../../zoo/html/zoo.html">zoo</a></code> </p> <h3>Examples</h3> <pre> ## 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) </pre> <hr /><div style="text-align: center;">[Package <em>xts</em> version 0.12.2 <a href="00Index.html">Index</a>]</div> </body></html>