read.xts: read a textfile and save it as xts-object

View source: R/functions.r

read.xtsR Documentation

read a textfile and save it as xts-object

Description

Read a text file using fread and directly save it as xts object.

Usage

read.xts(
  x,
  datecolumns = 1,
  format = "%Y-%m-%d %H:%M",
  header = TRUE,
  tz = "utc",
  skip = 0,
  cut.prefix = 0,
  ...
)

Arguments

x

character string. file to load

datecolumns

integer vector. Giving the columns with date informations

format

character string. Specify the format of the date

header

logical. Does the data have a header?

tz

character string. Time zone of the data

skip

integer: the number of lines of the data file to skip before beginning to read data.

cut.prefix

integer. Amount of leading characters that will be ignored in formatting the POSIXct object. Experimental!

...

additional arguments from other methods passed to fread

Details

Other than in older versions, where the standard arguments of this function were designed to read COSERO input and output files, this function by default reads tab-separated files using the time format Y-m-d H:M.

Value

an xts object.

Author(s)

Simon Frey

See Also

write.xts

Examples

fpath <- system.file("extdata","qobs_qsim.txt", package = "TigR")
out <- read.xts(x = fpath)

freysimon/TigeR documentation built on April 18, 2024, 4:57 p.m.