## 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])
Run the code above in your browser using DataLab