[R] Accessing variables inside a namespace

Santosh Srinivas santosh.srinivas at gmail.com
Thu Nov 18 02:12:02 CET 2010


Hello Group,

I am trying to see if there is way to access data that is inside another
namespace.
For e.g. the addATR function in the quantmod package calculates the ATR
using the TTR package and then plots it to the graph.

Now since it has already calculated the info that I need, can I access that
data which if I look at the function code is stored in a variable called
"atr"


library(TTR)
library(quantmod)
data(ttrc)
x <- subset(ttrc,select=c("Date","Open","High","Low","Close"))
x.z <- read.zoo(x)
x.xts <- as.xts(x.z)
chartSeries(x.xts)
addATR()


Just so that I don't need to recalculate the same stuff again. I believe the
data hasn't "expired" already.

Thanks for your help.
S



More information about the R-help mailing list