Thank you all. Both the get and the auto.assign=FALSE methods work.

On Mon, Aug 9, 2010 at 3:05 PM, Johnson, Cedrick W. <
cedrick@cedrickjohnson.com> wrote:

> you could try:
>
> OHLC(get(stock)) and colnames(get(stock))
>
> hth
> -c
>
>
> On 08/09/2010 06:48 AM, Raghuraman Ramachandran wrote:
>
>>  Hi
>>
>> I am trying to pass a stock's name as an argument to a function and then I
>> am trying to use getSymbols to get data. For example,
>> stock="AAPL"
>> stock = getSymbols(stock) returns "AAPL"
>> But, if I do an OHLC(stock) it cribs. Also colnames(stock) returns NULL as
>> stock is still considered a string rather than an AAPL. How do I overcome
>> this problem pls?
>> Basically I want the variable stock to exactly mimic the returned object
>> of
>> getSymbols().
>>
>> Thanks
>> Raghu
>>
>>        [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-SIG-Finance@stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only. If you want to post, subscribe first.
>> -- Also note that this is not the r-help list where general R questions
>> should go.
>>
>
> _______________________________________________
> R-SIG-Finance@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
>

	[[alternative HTML version deleted]]

