Hi,
i'm totally new to RStudio. So I hope you can help me with my problem:
I have loaded a csv-file into RStudio which includes data about the
year
month
day
hour
minute
second
in separate columns.
Now I have to create a new column bringing all these before mentioned columns together in a time stamp.
I already installed the lubridate-package and I know that I have to use the command yms_hms(), but I'm not sure what exactly to include into the brackets in order to bring the data from the different columns together.
Maybe it isn't that difficult, but I just can't find a solution.
Thanks for your help!
Thanks for the reply.
Let's take the data.frame you created as an example:
sample_df <- data.frame(
year = c(2020, 2020),
month = c(07, 08),
day = c(22, 23),
hour = c(10, 11),
minute = c(01, 02),
second = c(30, 32)
)
In this data.frame, I now have to create a new additional column, which takes the information from the other six columns (year, month, day, hour, minute, second) and provides it in the following format:
2020-07-22 10:01:30