File: as.data.table.xts.Rd

package info (click to toggle)
r-cran-data.table 1.12.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 13,084 kB
  • sloc: ansic: 12,667; sh: 13; makefile: 6
file content (27 lines) | stat: -rw-r--r-- 770 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
\name{as.data.table.xts}
\alias{as.data.table.xts}
\title{Efficient xts to as.data.table conversion}
\description{
  Efficient conversion xts to data.table.
}
\usage{
\method{as.data.table}{xts}(x, keep.rownames = TRUE, \dots)
}
\arguments{
\item{x}{xts to convert to data.table}

\item{keep.rownames}{keep xts index as \emph{index} column in result data.table}

\item{\dots}{ignored, just for consistency with \code{as.data.table}}
}
\seealso{ \code{\link{as.xts.data.table}} }
\examples{
if (requireNamespace("xts", quietly = TRUE)) {
  data(sample_matrix, package = "xts")
  sample.xts <- xts::as.xts(sample_matrix) # xts might not be attached on search path
  # print head of xts
  print(head(sample.xts))
  # print data.table
  print(as.data.table(sample.xts))
}
}