i am a student from Hamburg, Germany and i want modify some electricity-data(Regelzonensaldo) to a time series (XTS), but i don´t know how to merge the two columns(Date and Time) into one.
I tried:
as.Date(Gesamt_Regelzonensaldo_csv$Date, format = "%d/%m/%Y")
To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:
Hey again,
thank you one more time for your advice. I tried my best to convert with your given code and it worked for many rows but i have now the the message:
Warning messages:
1: 142443 failed to parse.
2: 139483 failed to parse.
3: In .parse_hms(..., order = "HM", quiet = quiet) :
Some strings failed to parse, or all strings are NAs
I can´t figure ou why some rows work and some don´t. I converted the excel in a csv data and imported it. Maybe this is the problem. In excel everything has the same format.
It would help if you could make a reprex, so we could experiment on your code and data. But it does look like some of your NAs occur when the hours and/or minutes have been stripped off. Excel is notorious for doing strange things to data. Some pre-formatting in Excel to date and time formats could possibly help. You may need to filter these problem rows and re-assign them new times or dates.