Hello,
It is recomended to post data using dput(). Something like
dput(head(DF, 20)) # or 30
Then, paste the output of this command in a post.
Untested, but I think it should work:
# Create a logical index into 'example2'
ix <- example2$V1 %in% setdiff(example2$V1,example1$V1)
example2[ix, ] # which rows does it index?
You could also save the results of setdiff() and then see which of
example2$V1 are %in% it. If the data.frame has many rows, this way could
save some memory. (setdifff(9 gives only 2 character values, versus 2
TRUE plus n-2 FALSE).
Hope this helps,
Rui Barradas
Em 25-06-2012 17:37, nathalie escreveu:
hi,
I have 2 files example 1 and example 2 and would like to know what is
in
example2 and not in example1 (attached)
V1 contain data which could be in duplicated which I am using as
identifiers
I used setdiff(example2$V1,example1$V1) to find the identifiers which
are specific to example2:
[1] "rs2276598" "rs17253672"
I am looking for a way to get an output with all columns (V1 to V14)
for these 2 identifiers....
thanks for any suggestions
format example1
V1 V2 V3 V4 V5 V6
1 rs4685 2:198257795 C ENSG00000115524 ENST00000424674 Transcript
2 rs4685 2:198257795 C ENSG00000115524 ENST00000335508 Transcript
3 rs788018 2:198265526 G ENSG00000115524 ENST00000335508 Transcript
4 rs788023 2:198283305 C ENSG00000115524 ENST00000335508 Transcript
5 rs41284843 2:25536827 A ENSG00000119772 ENST00000406659 Transcript
6 rs41284843 2:25536827 A ENSG00000119772 ENST00000321117 Transcript
7 rs41284843 2:25536827 A ENSG00000119772 ENST00000264709 Transcript
8 rs41284843 2:25536827 A ENSG00000119772 ENST00000380756 Transcript
9 rs3729680 3:178927410 G ENSG00000121879 ENST00000263967 Transcript
10 rs61744960 4:106156163 A ENSG00000168769 ENST00000305737 Transcript
11 rs61744960 4:106156163 A ENSG00000168769 ENST00000413648 Transcript
12 rs61744960 4:106156163 A ENSG00000168769 ENST00000540549 Transcript
13 rs61744960 4:106156163 A ENSG00000168769 ENST00000545826 Transcript
14 rs61744960 4:106156163 A ENSG00000168769 ENST00000380013 Transcript
15 rs61744960 4:106156163 A ENSG00000168769 ENST00000535110 Transcript
16 rs61744960 4:106156163 A ENSG00000168769 ENST00000394764 Transcript
17 rs61744960 4:106156163 A ENSG00000168769 ENST00000513237 Transcript
18 rs61744960 4:106156163 A ENSG00000168769 ENST00000265149 Transcript
19 rs2454206 4:106196951 G ENSG00000168769 ENST00000540549 Transcript
20 rs2454206 4:106196951 G ENSG00000168769 ENST00000513237 Transcript
V7 V8 V9 V10 V11 V12
V13
1 SYNONYMOUS_CODING 704 705 235 V gtA/gtG
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.