Re: [R] comparing two files

2008-09-05 Thread Jorge Ivan Velez
Hi there, See ?"%in%" Here is an example: > x=sample(1:10) > x [1] 2 1 10 5 4 7 3 6 8 9 > y=sample(4:20) > y [1] 17 16 18 10 8 19 4 5 11 13 12 14 20 6 7 9 15 > x[x%in%y] # "x" values present in "y" [1] 10 5 4 7 6 8 9 HTH, Jorge On Fri, Sep 5, 2008 at 2:57 PM, Rajasek

Re: [R] comparing two files

2008-09-05 Thread jim holtman
?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(ma

Re: [R] comparing two files

2008-09-05 Thread John Kane
?which which(C[,2]!= T) # untested --- On Fri, 9/5/08, Rajasekaramya <[EMAIL PROTECTED]> wrote: > From: Rajasekaramya <[EMAIL PROTECTED]> > Subject: [R] comparing two files > To: r-help@r-project.org > Received: Friday, September 5, 2008, 2:57 PM > Hi there >

[R] comparing two files

2008-09-05 Thread Rajasekaramya
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