[R] Merging lot of zoo objects

Michael Knudsen micknudsen at gmail.com
Tue Jul 21 10:09:11 CEST 2009


On Tue, Jul 21, 2009 at 9:07 AM, RON70<ron_michael70 at yahoo.com> wrote:

> I have 100 price data series like price1, price2, price3, ............. All
> are "zoo" objects. Now I want to merge all them together. Obviously I can do
> this using "merge(price1, price2, price3, ........)". However as I have lot
> of price series (almost 1000) above systax is very tiresome. Is there any
> other way on doing to in one-go?

How did you get the names price1, price2, ..., price_100 in the first
place? Did you make 100 lines of code? If you had stored the objects
in a list, such that

priceN = list_of_prices[[N]]

you could easily define a recursive function to do the job for you.
Would it difficult for you to read the data into a list?

When dealing with only a few sets, numbering objects as you do is no
problem, but for many objects it can become very cumbersome.

-- 
Michael Knudsen
micknudsen at gmail.com
http://lifeofknudsen.blogspot.com/




More information about the R-help mailing list