[BioC] read.frame

Naomi Altman naomi at stat.psu.edu
Sat Jul 24 14:56:40 CEST 2004


Dear SP,
The problem is that the set commands work on vectors, and you have dataframes.

Try

CiS=intersect(as.vector(c),as.vector(s))

Also, avoid using "c" as a variable name, as it is also the name of an 
important function, concatenate, that allows you to create vectors and also 
change objects from matrices to vectors.

--Naomi Altman



At 08:21 PM 7/7/2004 -0700, S Peri wrote:
>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
>
>_______________________________________________
>Bioconductor mailing list
>Bioconductor at stat.math.ethz.ch
>https://www.stat.math.ethz.ch/mailman/listinfo/bioconductor

Naomi S. Altman                                814-865-3791 (voice)
Associate Professor
Bioinformatics Consulting Center
Dept. of Statistics                              814-863-7114 (fax)
Penn State University                         814-865-1348 (Statistics)
University Park, PA 16802-2111



More information about the Bioconductor mailing list