I have a script that is supposed to download prices over time. It returns a dataframe of Date, Product, Price.

I want to combine them and have this loop:

```
for(product in products2){
  series=downloadPrices(product)
  series$date= as.Date(series$date)
  print(product)
  if(new==FALSE){
    combined <-merge(combined,series,by="date")  
    print("merging")
  }else{ 
    new=FALSE
    combined=series
    print("first one")
  }  
}

```

This results in:

```
column names 'underlying.x', 'price.x', 'underlying.y', 'price.y' are duplicated in the result

```

How can I force r to create underlying.z, price.z... and so on?

removing the by="date" results in an empty dataframe.

It works okay if there are only 3 elementsa in product. If it's four, the issue happens.

EDIT:

Dataset downloaded via the downladPrices:

```
date    underlying  price
2012-01-03 00:00:00 Lollipop    -1.66598985
2012-01-04 00:00:00 Lollipop    -2.77954315
2012-01-05 00:00:00 Lollipop    -3.82370558
2012-01-06 00:00:00 Lollipop    -4.90197970

```