EVOLUTION-MANAGER
Edit File: as.xts.data.table.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: Efficient data.table to xts conversion</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.data.table {data.table}"><tr><td>as.xts.data.table {data.table}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Efficient data.table to xts conversion</h2> <h3>Description</h3> <p>Efficient conversion of data.table to xts, data.table must have <em>POSIXct</em> or <em>Date</em> type in first column. </p> <h3>Usage</h3> <pre> as.xts.data.table(x, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>data.table to convert to xts, must have <em>POSIXct</em> or <em>Date</em> in the first column. All others non-numeric columns will be omitted with warning.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>ignored, just for consistency with generic method.</p> </td></tr> </table> <h3>See Also</h3> <p><code><a href="as.data.table.xts.html">as.data.table.xts</a></code> </p> <h3>Examples</h3> <pre> if (requireNamespace("xts", quietly = TRUE)) { sample.dt <- data.table(date = as.Date((Sys.Date()-999):Sys.Date(),origin="1970-01-01"), quantity = sample(10:50,1000,TRUE), value = sample(100:1000,1000,TRUE)) # print data.table print(sample.dt) # print head of xts print(head(as.xts.data.table(sample.dt))) # xts might not be attached on search path } </pre> <hr /><div style="text-align: center;">[Package <em>data.table</em> version 1.14.4 <a href="00Index.html">Index</a>]</div> </body></html>