one approach is the following:

DF <- read.table(textConnection(
"client       page
730001 46101
730001 46102
730019 46101
730035 46101
730040 46101
730040 46102
730040 46104
730040 46105
730052 46101
730052 46102
730074 46101
730074 46102
730074 46103"), header = TRUE)
closeAllConnections()

DF$diff <- with(DF,
    ave(page, client, FUN = function (x) c(0, diff(x)))
)
DF[DF$diff > 1, ]
unique(DF$client[DF$diff > 1])


I hope it helps.

Best,
Dimitris


On 10/21/2010 8:47 AM, Pauline wrote:
Hi,

Not sure how to go about checking for missing report pages per client. See
example below; I like to extract client 730040, because page 46103 is missing.


     client       page
730001 46101
730001 46102
730019 46101
730035 46101
730040 46101
730040 46102
730040 46104
730040 46105
730052 46101
730052 46102
730074 46101
730074 46102
730074 46103
I appreciate any help,
Pauline




        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
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.


--
Dimitris Rizopoulos
Assistant Professor
Department of Biostatistics
Erasmus University Medical Center

Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands
Tel: +31/(0)10/7043478
Fax: +31/(0)10/7043014
Web: http://www.erasmusmc.nl/biostatistiek/

______________________________________________
R-help@r-project.org mailing list
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.

Reply via email to