On 08/12/2023 4:30 p.m., David Winsemius wrote:
On 12/7/23 08:21, Sorkin, John wrote:
Colleagues,
I have a matrix of character data that represents date and time. The format of
each element of the matrix is
"2020-09-17_00:00:00"
How can I convert the elements into a valid R date-time constant
On 12/7/23 08:21, Sorkin, John wrote:
Colleagues,
I have a matrix of character data that represents date and time. The format of
each element of the matrix is
"2020-09-17_00:00:00"
How can I convert the elements into a valid R date-time constant?
You will not be able to store these datetime
17_00:00:00", format = "%Y-%m-%d_%H:%M:%S")
[1] "2020-09-17 CEST"
>
(in my time zone).
> -Original Message- From: R-help
> On Behalf Of Sorkin, John
> Sent: Thursday, December 7, 2023 11:22 AM To:
> r-help@r-project.org (r-help@r-
`anytime` was written for this:
> anytime::anytime("2020-09-17_00:00:00")
[1] "2020-09-17 CDT"
> class(anytime::anytime("2020-09-17_00:00:00"))
[1] "POSIXct" "POSIXt"
>
Dirk
--
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
__
Às 16:30 de 07/12/2023, Rui Barradas escreveu:
Às 16:21 de 07/12/2023, Sorkin, John escreveu:
Colleagues,
I have a matrix of character data that represents date and time. The
format of each element of the matrix is
"2020-09-17_00:00:00"
How can I convert the elements into a valid R date-time
Às 16:21 de 07/12/2023, Sorkin, John escreveu:
Colleagues,
I have a matrix of character data that represents date and time. The format of
each element of the matrix is
"2020-09-17_00:00:00"
How can I convert the elements into a valid R date-time constant?
Thank you,
John
John David Sorkin M
Look at the lubridate package in R.
Regards,
Tim
-Original Message-
From: R-help On Behalf Of Sorkin, John
Sent: Thursday, December 7, 2023 11:22 AM
To: r-help@r-project.org (r-help@r-project.org)
Subject: [R] Convert character date time to R date-time variable.
[External Email
Colleagues,
I have a matrix of character data that represents date and time. The format of
each element of the matrix is
"2020-09-17_00:00:00"
How can I convert the elements into a valid R date-time constant?
Thank you,
John
John David Sorkin M.D., Ph.D.
Professor of Medicine, University of
8 matches
Mail list logo