Skip to content
Back to formatted view

Raw Message

Message-ID: <604c2cd37be8d7392f3c65830bcb7c9e@mail.nih.gov>
Date: 2005-04-29T11:11:39Z
From: Sean Davis
Subject: how to replace text...
In-Reply-To: <e206273d0504290311460cd671@mail.gmail.com>

On Apr 29, 2005, at 6:11 AM, Jonathan Q. wrote:

> if I have....
>
> QQQQ<-priceIts("QQQQ",quote="Close")
> QQQQ<-priceIts("QQQQ",quote="Close");plot(QQQQ)
>
> and then i want to do the same thing but say with IBM instead of QQQQ
> is there an easy way like replace qqqq/ibm
>


You should probably use a list instead.  This is a FAQ (see 7.21):

http://cran.r-project.org/doc/FAQ/R-FAQ.html

Here is about how you might do it (untested):

pricelist <- list()

pricelist[['IBM']] <- pricelts('IBM',quote="Close")
pricelist[['QQQQ']] <- pricelts('QQQQ',quote="Close")

par(ask=T)
lapply(pricelist,plot)

Does this do what you want?

Sean