Re: [R] Help with replace()

2018-07-14 Thread Uwe Ligges
. Max. "1977-07-16" "1984-03-13" "1990-08-16" "1990-12-28" "1997-07-29" "2002-12-31" WHP From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Thursday, July 12, 2018 11:29 AM To: Bill Poling Cc: r-help (r-help@r-project.o

Re: [R] Help with replace()

2018-07-12 Thread Bill Poling
2-12-31" WHP From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Thursday, July 12, 2018 11:29 AM To: Bill Poling Cc: r-help (r-help@r-project.org) Subject: Re: [R] Help with replace() > On Jul 12, 2018, at 8:17 AM, Bill Poling > mailto:bill.pol...@zelis.com>> wrote: &g

Re: [R] Help with replace()

2018-07-12 Thread David Winsemius
> On Jul 12, 2018, at 8:17 AM, Bill Poling wrote: > > > R version 3.5.1 (2018-07-02) -- "Feather Spray" > Copyright (C) 2018 The R Foundation for Statistical Computing > Platform: x86_64-w64-mingw32/x64 (64-bit) > > Hi. > > I have data set with day month year integers. I am creating a date

[R] Help with replace()

2018-07-12 Thread Bill Poling
R version 3.5.1 (2018-07-02) -- "Feather Spray" Copyright (C) 2018 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) Hi. I have data set with day month year integers. I am creating a date column from those using lubridate. a hundred or so rows failed to

Re: [R] Help me replace a for loop with an apply function

2009-10-01 Thread jim holtman
Will this work: x - read.table(textConnection( day user_id + 2008/11/012001 + 2008/11/012002 + 2008/11/012003 + 2008/11/012004 + 2008/11/012005 + 2008/11/022001 + 2008/11/022005 + 2008/11/032001 + 2008/11/032003 + 2008/11/032004 + 2008/11/03

Re: [R] Help me replace a for loop with an apply function

2009-10-01 Thread gd047
Congratulations! Could you explain to me the reason you add an initial TRUE value in the cumulatice sum? jholtman wrote: Will this work: x - read.table(textConnection( day user_id + 2008/11/012001 + 2008/11/012002 + 2008/11/012003 + 2008/11/012004 +

Re: [R] Help me replace a for loop with an apply function

2009-10-01 Thread jim holtman
What I am doing is trying to determine where the dates are not sequential (difference is not one day). Everytime that this occurs, the expression 'diff(.days) != 1' is TRUE and this is where a new sequence starts. 'diff' will return a vector one shorter than its input; I am assuming that the