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@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.