[R] read.frame

S Peri biocperi at yahoo.com
Thu Jul 8 04:56:07 CEST 2004


Hello group, 
  I am learning R and I am new to many concepts.I face
the following errors when I am trying to execute the
following. I have 4 text files with protein accession
numbers. I wanted to represent them in a venn diagram
and for that I using intersect and setdiff functions.

My data looks like this:

file1.txt (c):
NP_000005
NP_000020
NP_000030
NP_000053

file2.txt(e):
NP_000005
NP_000020
NP_000030
NP_000031
NP_000053
NP_000055
NP_000087

file3.txt(h):
NP_000005
NP_000020
NP_000030
NP_000053
NP_000055
NP_000057
NP_000087

file4.txt (s):
NP_000005
NP_000020
NP_000030
NP_000033
NP_000053
NP_000055
NP_000087
NP_000168


Now I did the following FIRST time:
c=read.table("file1.txt")
e=read.table("file2.txt")
s=read.table("file4.txt")
h=read.table("file3.txt")

> class(c)
[1] "data.frame"
> class(s)
[1] "data.frame"
> CiS=intersect(c,s)
> CiS
NULL data frame with 0 rows 
##### Why am I getting NULL data error. I know there
are common elements between c and S. ##########

> CiS<-intersect(read.matrix(c,s))
Error in unique(y[match(x, y, 0)]) : Argument "y" is
missing, with no default
> CiS<-intersect(read.frame(c,s))
Error in unique(y[match(x, y, 0)]) : Argument "y" is
missing, with no default

##### Why am I getting this error.



Second thing I did:

I loaded the data as data.frame instead read.table(). 
Again I never get intersection of C,E and S,H. 


Can any one please help me. 
thank you

SP




More information about the R-help mailing list