Please do your work to form a well-posed (context including!) question,
like I've asked before.

On Monday, October 22, 2012, sheenmaria wrote:

> Sir,
>      This code give the answer but i have a doubt,
> i need to retrieve the data of more than one tickers so i used the code
> like this
>
> v=c("IBM","AA")
> library(quantmod)
> #v1 = getSymbols(v, auto.assign = TRUE)
> #v1
> print ="-------------------------------------------------"
> for(i in (getSymbols(v, auto.assign = TRUE))){
> cat("to.yearly(",i, ")\n")
> to.yearly(i)
> #to.yearly(IBM)
> }
>
>
Please read ?getSymbols more closely -- auto.assign only has effect when
length(v) ==1.

You probably want something like

lapply(mget(getSymbols(v), to.yearly)

I'll let you try to work out how that particular incantation works and form
a context-including follow-up if you've got trouble with it.

Cheers,
RMW

>
> this also shows the same error
>  "Error in try.xts(x) :
>   Error in UseMethod("as.xts") :   no applicable method for 'as.xts'
> applied to an object of class "character"
>
> Actually i need to find out the best ticker based from teh site(yahoo) .
> if i have 3 ticker like "IBM,AA,MSFT" i need to fidn out the best ticker
> from these, based on the yearly performance


Small question? Look at the PerformanceAnalytics package  for a wide
variety of ways to answer this question.


> Am newly started the 'R' so i haven't more idea about this . can u help me
> plz
>
> Thank you
>
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/to-yearly-tp4646723p4646959.html
> Sent from the R help mailing list archive at Nabble.com.
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org <javascript:;> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]


