attach | R Documentation |
Attaches a "timeSeries"
object to the search path.
## S4 method for signature 'timeSeries'
attach(what, pos = 2, name = deparse(substitute(what)),
warn.conflicts = TRUE)
name |
alternative way to specify the database to be attached.
See for details |
pos |
an integer specifying position in |
warn.conflicts |
a logical value. If |
what |
database to be attached. This may currently be a |
the environment, invisibly, with a name
attribute
The function detach
from the base
package can be used to
detach the attached objects.
## 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 \code{"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])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.