Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

timeSeries-readSeries

Reads a 'timeSeries' from a File


Description

Reads a file in table format and creates a timeSeries object from it.

Usage

readSeries(file, header = TRUE, sep = ";", zone = "", 
    FinCenter = "", format, ...)

Arguments

file

the filename of a spreadsheet data set from which to import the data records.

FinCenter

a character with the the location of the financial center named as "continent/city".

header

a logical value indicating whether the file contains the names of the variables as its first line. If missing, the value is determined from the file format: 'header' is set to 'TRUE' if and only if the first row contains one fewer field than the number of columns.

format

a character string with the format in POSIX notation specifying the timestamp format. Note, the format has not to be specified if the first column in the file has the timestamp format specifyer, e.g. "%Y-%m-%d" for the short ISO 8601 format.

sep

the field seperator used in the spreadsheet file to separate columns. By default ";". Note, if sep=";" is specified, and reading the series fails, then the reading is automatically repeated with sep=",".

zone

the time zone or financial center where the data were recorded. By default zone="" which is short for GMT.

...

Additional arguments passed to read.table() function which is used to read the file.

Details

The first column of the table must hold the timestamps. Format of the stimestamps can be either specified in the header of the first column or by the format argument.

Value

Returns a S4 object of class timeSeries.


timeSeries

Financial Time Series Objects (Rmetrics)

v3062.100
GPL (>= 2)
Authors
Diethelm Wuertz [aut] (original code), Tobias Setz [cre], Yohan Chalabi [ctb], Martin Maechler [ctb] (<https://orcid.org/0000-0002-8685-9910>)
Initial release
2020-01-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.