[R] finding missing lines...

From: Vittorio <vdemart1_at_tin.it>
Date: Fri 07 Oct 2005 - 18:02:24 EST


Take this as an example:

> a=data.frame(col1=c(1,2,3,4,5), col2=c
("my","beloved","daughter","son","wife"))
> b=data.frame(col1=c(1,2,4),

col2=c("my","beloved","son"))
> a

  col1     col2
1    1       my

2
2 beloved
3 3 daughter
4    4      son
5    5     wife

> b
  

col1 col2
1 1 my
2 2 beloved
3 4 son

As you can
see in b is equal to a with exception of lines of a with col1= 3 and col1=5 that are missing.

How can I obtain a third dataframe made of the missing lines only, e.g.

> c

  col1 col2
1 3 daughter
2
5 wife

Ciao
Vittorio



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Oct 07 18:12:48 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:38 EST