[R] comparing two files

jim holtman jholtman at gmail.com
Fri Sep 5 21:43:39 CEST 2008


?match

> T.v <- sample(1:20)
> C.df <- data.frame(a=1:10, b= sample(1:20, 10))
> T.v
 [1] 10 12  9  4 14 11 19  2 18  5 16  6  7 17  8 20  1 13  3 15
> C.df
    a  b
1   1 10
2   2 17
3   3  8
4   4  5
5   5  2
6   6 16
7   7 19
8   8  7
9   9 18
10 10 14
> # find the missing values
> T.v[is.na(match(T.v, C.df[,2]))]
 [1] 12  9  4 11  6 20  1 13  3 15
>


On Fri, Sep 5, 2008 at 2:57 PM, Rajasekaramya <ramya.victory at gmail.com> wrote:
>
> Hi there
>
> I have two object on is a vector T and the other is  dataframe C.
> vector T has more no of rows when comapred with a dataframe Ccolumn[,2].I
> want to find the the missing rows in dataframe C.That is those values that
> are not matchig  in dataframe C[,2]
>
> Kindly give me suggestion on how to go about it.
>
> Ramya
>
> --
> View this message in context: http://www.nabble.com/comparing-two-files-tp19337486p19337486.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?



More information about the R-help mailing list