0

Help me please with follow:

I have a list like that:

             open   close
12.15.16  $15  $16
12.16.16  $18  $19

(Index: Date)

But I need a data-frame like this:

 date       open   close
12.15.16  $15  $16
12.16.16  $18  $19

Oktu
  • 187
  • 1
  • 4
  • 10
  • How do you have a list like that? Can you `dput()` the object so we can see how it's actually structured? This isn't clear from your text representation. See [how to create a reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – MrFlick Apr 06 '17 at 15:51

1 Answers1

1

Based on the data showed, it looks like the OP have a data.frame with rownames and wanted to have a separate column with rownames. In that case

 df2 <- cbind(date = row.names(df1),df1)
 row.names(df2) <- NULL
akrun
  • 874,273
  • 37
  • 540
  • 662