[R] Is it possible to calculate in r the number of days and count of b in var r from the following table:

Bert Gunter bgunter@4567 @end|ng |rom gm@||@com
Thu Apr 18 17:45:16 CEST 2019


Yes.

Have you gone through any R tutorials, yet? There are many good ones on the
web, some of which are listed here:
https://www.rstudio.com/online-learning/
See also the "Intro to R" tutorial that ships with R.

Spending a little time with these will help you understand R's capabilities
and, of course, learn how to use them.

Cheers,
Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Thu, Apr 18, 2019 at 8:18 AM ajaykumar cp <ajaykumarcp using gmail.com> wrote:

> Hello
>
> Is it possible to calculate in r the number of days and count of b in var r
> from the following table:
>
>
> id r s t u
> 1 a 100 1 27-06-2017
> 1 a 200 0 29-06-2017
> 1 b 300 0 01-07-2017
> 2 a 500 1 12-06-2017
> 3 b 100 0 02-07-2017
> 3 a 600 1 02-07-2017
> 4 a 200 0 12-06-2017
> 4 a 300 1 15-06-2017
> 4 b 200 0 18-06-2017
> 4 a 100 0 01-07-2017
> 5 a 200 0 04-06-2017
>
> grouped by unique ID where the condition = when r = b, sum of s >= sum of s
> when t = 1?
>
> https://stackoverflow.com/q/55724900/11373077 for the discussions
>
> Thank you in advance
>
>
> --
> C P Ajaykumar
>
>         [[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.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list