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

base-attach

Attach a timSeries to the search path


Description

Attaches a 'timeSeries' object to the search path.

Usage

## S4 method for signature 'timeSeries'
attach(what, pos = 2, name = deparse(substitute(what)), 
    warn.conflicts = TRUE)

Arguments

name

alternative way to specify the database to be attached. See for details help(attach,package=base).

pos

an integer specifying position in search() where to attach the database. See for details help(attach,package=base).

warn.conflicts

a logical value. If TRUE, warnings are printed about conflicts from attaching the database, unless that database contains an object .conflicts.OK. A conflict is a function masking a function, or a non-function masking a non-function. See for details help(attach,package=base).

what

[attach] -
database to be attached. This may currently be a timeSeries object, a data.frame or a list or a R data file created with save or NULL or an environment. See for details help(attach, package=base).

Value

The environment is returned invisibly with a name attribute.

Note

Note, the function detach from the base package can be used to detach the attached objects.

Examples

## Load Microsoft Data Set - 
   x <- MSFT[1:10, ]
   colnames(x)
   
## Attach the Series and Compute the Range - 
   attach(x)
   range <- High - Low
   range
   
## Convert Vector to a timeSeries Object -
   timeSeries(data=range, charvec=time(x), units="Range")
   
## Detach the series from the search path -
   detach("x")
   ans <- try(High, silent=TRUE)
   cat(ans[1])

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.