I have a data frame on r of various historical stock price, So i would like to insert a first column with dates starting 2019-12-31 until yesterday (since it's closing price).
Asked
Active
Viewed 147 times
0
-
1Welcome. Please take a moment to read [this post](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) on how to ask a good question in R. In particular, please include a reproducible example of your data by pasting the output of ``dput(data)`` into your question. It's also helpful to show us what you tried so far. Thank you. – user438383 Jul 14 '21 at 14:03
-
1Try `data$first_column <- seq(as.Date("2019-12-31"), Sys.Date()-1, by=1)`. – Martin Gal Jul 14 '21 at 14:07