Hi Your question is barely understandable. Maybe you wanted
?aggregate but without further precisement it is difficult to provide definitive answer. Cheers Petr > -----Original Message----- > From: R-help <r-help-boun...@r-project.org> On Behalf Of ajaykumar cp > Sent: Wednesday, April 17, 2019 4:31 PM > To: r-help@r-project.org > Subject: [R] Is it possible to calculate in r the number of days and count of > b in > var r from the following table: > > 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. Osobní údaje: Informace o zpracování a ochraně osobních údajů obchodních partnerů PRECHEZA a.s. jsou zveřejněny na: https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information about processing and protection of business partner’s personal data are available on website: https://www.precheza.cz/en/personal-data-protection-principles/ Důvěrnost: Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a podléhají tomuto právně závaznému prohláąení o vyloučení odpovědnosti: https://www.precheza.cz/01-dovetek/ | This email and any documents attached to it may be confidential and are subject to the legally binding disclaimer: https://www.precheza.cz/en/01-disclaimer/ ______________________________________________ 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.