I have a csv datasheet with 7 columns filled with numeric values.
3 of these columns represent the date of the measurements: "YYYY", "MM", "DD", followed by 4 columns of relevant corresponding data: "qobs", "ckhs", "qceq", "qcol".
How do I convert the three first columns filled with numeric values into a date-datatype, while maintaining the dependency of the dates to the corresponding date?
# YYYY, MM, DD, qobs, ckhs, qceq, qcol
# 1 1981, 1, 1, 7.136, 0, 0, 0
# 2 1981, 1, 2, 6.76, 0, 0, 0
# 3 1981, 1, 3, 10.886, 0, 0, 0
# ...
I looked online and only found solutions using the as.Date function that correspond to a single character string. I'm fairly new to programming and have only used R for a couple of days, so an elementary explanation would be greatly appreciated.
There's a specific
lubridatefunction for this: