ajaykumar cp
2019-Apr-17 14:30 UTC
[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]]
Bert Gunter
2019-Apr-18 15:45 UTC
[R] Is it possible to calculate in r the number of days and count of b in var r from the following table:
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 at 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 at 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]]
PIKAL Petr
2019-Apr-23 07:11 UTC
[R] Is it possible to calculate in r the number of days and count of b in var r from the following table:
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-bounces at r-project.org> On Behalf Of ajaykumar cp > Sent: Wednesday, April 17, 2019 4:31 PM > To: r-help at 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 at 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/