Re: [R] transforming dates

2019-11-03 Thread Spencer Graves
On 2019-11-03 17:04, Peter Dalgaard wrote: On 3 Nov 2019, at 21:22 , David Winsemius wrote: On 11/3/19 11:51 AM, Bert Gunter wrote: === Hey, that's my birthday! Err, no it isn't... ;-)   Is that November 3 of 2019 or March 19 of 2011 or 11 March 2019?  [please excuse the typ

Re: [R] transforming dates

2019-11-03 Thread Spencer Graves
On 2019-11-03 17:04, Peter Dalgaard wrote: On 3 Nov 2019, at 21:22 , David Winsemius wrote: On 11/3/19 11:51 AM, Bert Gunter wrote: === Hey, that's my birthday! Err, no it isn't... ;-)   Is that November 11 of 2019 or March 19 of 2011 or 11 March 2019?   The English sti

Re: [R] transforming dates

2019-11-03 Thread Peter Dalgaard
> On 3 Nov 2019, at 21:22 , David Winsemius wrote: > > > On 11/3/19 11:51 AM, Bert Gunter wrote: === Hey, that's my birthday! Err, no it isn't... ;-) -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone:

Re: [R] transforming dates

2019-11-03 Thread Bert Gunter
Yes, indeed. Thanks, David. Cheers, Bert On Sun, Nov 3, 2019 at 12:22 PM David Winsemius wrote: > > On 11/3/19 11:51 AM, Bert Gunter wrote: > > Rui is right -- lubridate functionality and robustness is better -- but > > just for fun, here is a simple function, poorly named reformat(), that > >

Re: [R] transforming dates

2019-11-03 Thread David Winsemius
On 11/3/19 11:51 AM, Bert Gunter wrote: Rui is right -- lubridate functionality and robustness is better -- but just for fun, here is a simple function, poorly named reformat(), that splits up the date formats, cleans them up and standardizes them a bit, and spits them back out with a sep chara

Re: [R] transforming dates

2019-11-03 Thread Bert Gunter
Rui is right -- lubridate functionality and robustness is better -- but just for fun, here is a simple function, poorly named reformat(), that splits up the date formats, cleans them up and standardizes them a bit, and spits them back out with a sep character of your choice (your original split and

Re: [R] Another Real Basic Question

2019-11-03 Thread Linus Chen
A title like "Real basic question" is not quite informative... On Fri, 18 Oct 2019 at 17:45, John Kane wrote: > > Can you open in a text editor? > > On Wed, 16 Oct 2019 at 23:11, Phillip Heinrich wrote: > > > > In the Source window of RStudio (upper left) I save my code (File/Save) but > > can

Re: [R] error in train function

2019-11-03 Thread David Winsemius
On 11/1/19 11:27 AM, javed khan wrote: > Hi > > I receive the following error, where is the problem? > > Error in train(Effort ~ ., data = d, method = "lpSVM", trControl = > fitControl, : >unused arguments (data = d, method = "lpSVM", trControl = fitControl, > verbose = FALSE, metric = "ROC"

Re: [R] transforming dates

2019-11-03 Thread Rui Barradas
Hello, I believe the simplest is to use package lubridate. Its functions try several formats until either one is right or none fits the data. x <- c('11/7/2016', '14-07-16') lubridate::dmy(x) #[1] "2016-07-11" "2016-07-14" The order dmy must be the same for all vector elements, if not y <-