Re: [R] Convert two-dimensional array into a three-dimensional array.

2023-12-08 Thread Bert Gunter
OK. I'm not getting what you want, so feel free to ignore this if you think I've missed the point completely and don't want to waste your time. Won't be my first time clueless. A 3-D array can be thought of as as a "pile" of 2-D flats, so a 10 x 2 x 10 array consists of 10 2-d flats, each 10 x 2.

[R] Convert two-dimensional array into a three-dimensional array.

2023-12-08 Thread Sorkin, John
Colleagues I want to convert a 10x2 array: # create a 10x2 matrix. datavals <- matrix(nrow=10,ncol=2) datavals[,] <- rep(c(1,2),10)+c(rnorm(10),rnorm(10)) datavals into a 10x3 array, ThreeDArray, dim(10,2,10). The values storede in ThreeDArray's first dimensions will be the data stored in data

Re: [R] Convert character date time to R date-time variable.

2023-12-08 Thread Duncan Murdoch
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

Re: [R] Convert character date time to R date-time variable.

2023-12-08 Thread David Winsemius
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

Re: [R] Convert character date time to R date-time variable.

2023-12-08 Thread Martin Maechler
> Ebert,Timothy Aaron > on Thu, 7 Dec 2023 16:29:09 + writes: > Look at the lubridate package in R. Regards, Tim Absolutely *un*needed here !! - as others mention in this thread. Very simple with base R: > strptime("2020-09-17_00:00:00", format = "%Y-%m-%d_%H:%M:%S") [