Learn R Programming

timeSeries (version 4030.106)

print-methods: Print 'timeSeries' objects

Description

Print 'timeSeries' objects.

Usage

# S4 method for timeSeries
show(object)

# S4 method for timeSeries print(x, FinCenter = NULL, format = NULL, style = c("tS", "h", "ts"), by = c("month", "quarter"), ...)

Value

Prints an object of class timeSeries.

Arguments

object,x

an object of class timeSeries.

FinCenter

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

format

the format specification of the input character vector, a character string with the format in POSIX notation.

style

a character string, one of "tS", "h", or "ts".

by

a character string, one of "month", "quarter".

...

arguments passed to other methods.

Details

show does not have additional arguments.

The print method allows to modify the way the object is shown by explicitly calling print.

The default for style is tS. For univariate time series the style = "h" causes the object to be printed as a vector with the time stamps as labels. Finally, style = "ts" like objects from base R class "ts". The last value is suitable for quarterly and monthly time series.

Examples

Run this code
## Load Micsrosoft Data - 
   setRmetricsOptions(myFinCenter = "GMT")
   LPP <- MSFT[1:12, 1:4]

## Abbreviate Column Names - 
   colnames(LPP) <- abbreviate(colnames(LPP), 6)
   
## Print Data Set -
   print(LPP)
   
## Alternative Use, Show Data Set - 
   show(LPP)

## a short subseries to demo 'print'
   hC <- head(MSFT[ , "Close"])
   class(hC)
   print(hC)
   print(hC, style = "h")

Run the code above in your browser using DataLab