[BioC] as.numeric and NA
Kasper Daniel Hansen
k.hansen at biostat.ku.dk
Mon May 30 23:00:27 CEST 2005
What Wolfgang is implying is that it is a rather strange thing you want
to do. Your command was
as.numeric(sampleNames(data.raw))
with data.raw an AffyBatch object. Now,
sampleNames(data.raw)
will return you a vector of sampleNames, which is a character vector
with names associated with each sample. I believe the default is to put
the filenames there. So the command
sampleNames(data.raw)
should return a vector of filesnames. It is not at all clear how these
filenames should be converted to numbers. Compare
> as.numeric(c("1","2","3"))
[1] 1 2 3
> as.numeric(c("a","b","c"))
[1] NA NA NA
Warning message:
NAs introduced by coercion
Kasper
On Mon, May 30, 2005 at 01:47:49PM +0200, Mohammad Esad-Djou wrote:
> Thank you for your answer.
>
> > have you tried
> >
> > exprs(data.raw) or
> > intensity(data.raw)
> >
> Yes, I already tried exprs(data.raw).
> Unfortunately does not help me. I simplified my question, so that it can be answered concretely.
> I will read again R manual.
>
> best Regards,
> Mohammad
>
>
>
> Wolfgang Huber <huber at ebi.ac.uk> schrieb am 30.05.05 13:18:38:
> >
> > Mohammad,
> >
> > Also, please consider that the software is written by and the mailing
> > list discussions are provided by volunteers. So before posting such a
> > question, please consider reading the vignette of the affy package
> > first, and perhaps a manual of the R language.
> >
> > Best wishes
> > Wolfgang
> >
> > Mohammad Esad-Djou wrote:
> > > Hello,
> > >
> > > I would like to use for 42 experiments "as.numeric" (objects of type '"numeric"')
> > > I wrote in such a way:
> > >
> > >
> > >>library(affy)
> > >>data.raw <- ReadAffy(filenames= "./R/ME_cel/Expt1_R1.CEL",
> > >
> > > ... "./R/ME_cel/Expt14_R3.CEL")
> > >
> > >
> > >>as.numeric(sampleNames(data.raw))
> > >
> > > [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> > > [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
> > > Warning message:
> > > NAs introduced by coercion
> > >
> > >
> > > How can I find correctly numeric values of data.raw?
> > >
> > > Thanks,
> > > Mohammad Esad-Djou
> > >
> > >
> >
> >
> > Best regards
> > Wolfgang
> >
> > -------------------------------------
> > Wolfgang Huber
> > European Bioinformatics Institute
> > European Molecular Biology Laboratory
> > Cambridge CB10 1SD
> > England
> > Phone: +44 1223 494642
> > Fax: +44 1223 494486
> > Http: www.ebi.ac.uk/huber
> > -------------------------------------
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
--
Kasper Daniel Hansen, Research Assistant
Department of Biostatistics, University of Copenhagen
More information about the Bioconductor
mailing list