[R] Method Guidance

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Wed Jan 12 03:33:29 CET 2022


1) Figure out how to post plain text please. What you saw is not what we see.

2) I see a "table" of input information but no specific expectation of what would come out of this hypothetical function.

3) Maybe you will find something relevant in this blog post: https://jdnewmil.github.io/blog/post/cumsum-and-diff-tricks/

ps not sure what "grate so sour" was supposed to be.

pps While loops are not necessarily evil.

On January 11, 2022 4:56:20 PM PST, Jeff Reichman <reichmanj using sbcglobal.net> wrote:
>R-Help Forum
>
> 
>
>Looking for a little guidance. Have an issue were I'm trying to determine
>the time between when Event A happened(In days) to when a subsequent Event B
>happens. For Example at Time 1 Evat A happens and subsequently Event B
>happens at the same day (0) and the next day (1) then Event A happens again
>at time 4 and Event B happens the next day and 3 days later so on and so
>forth. I gather there is no function that will do that so I suspect I will
>need to grate so sour of do while loop?  Any suggestions?
>
> 
>
> 
>
>Time      Event_A               Event_B               Time_B
>
>1              1                              1
>0
>
>2              0                              1
>1                              
>
>3              0                              0
>0
>
>4              1                              0
>0
>
>5              0                              1
>1
>
>6              0                              0
>0
>
>7              0                              1
>3
>
>8              1                              1
>0
>
>9              0                              0
>0
>
>10           0                              1                              2
>
>
> 
>
>Jeff Reichman    
>
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list