vincentarelbundock / Rdatasets

A collection of datasets originally distributed in R packages
https://vincentarelbundock.github.io/Rdatasets
Other
323 stars 435 forks source link

how to attach dates to the `EuStockMarkets` data set #20

Closed michael-a-green closed 2 years ago

michael-a-green commented 2 years ago

Hi Vincent,

How do you attach real dates to the EuStockMarkets data set? I think that the mts column in the EuStockMarkets data set you are sharing is missing, which may help me to get to where I need to go. Would you add that back?

Thanks,

vincentarelbundock commented 2 years ago

Hi Michael,

I have never worked with objects of class mts. To save it as a CSV file, I first need to convert it to a data.frame in the get_data function of my scrape.R script. For example, here is how I convert objects of class ts:

https://github.com/vincentarelbundock/Rdatasets/blob/master/scrape.R#L25

Could you recommend a better way to convert mts objects to a simple data.frame that can be saved to CSV?

vincentarelbundock commented 2 years ago

Closing this now, but feel free to reopen if you have a suggestion on the best way to proceed.