[BioC] Help with "Error in Summary.factor(..., na.rm = na.rm) : "max" not meaningful for factors", please?

Ramon Diaz-Uriarte rdiaz at cnio.es
Wed Jul 2 14:50:28 MEST 2003


Hola Fátima,

I think the problem is that your class labels (rmadata2$Genotype) are a 
factor, but they should be a vector of integers starting at 0. 

The help for mt.maxT says:
 "classlabel: A vector of integers corresponding to observation (column)
          class labels. For k classes, the labels must be integers
          between 0 and k-1."

You can easily achieve that by doing:
my.classlabels <- as.numeric(rmadata2$Genotype) - 1

Best,

Ramón



On Wednesday 02 July 2003 13:27, Fátima Núñez wrote:
> Hello all,
>
> At the moment I'm trying to obtain adjusted p-values using the maxT and
> minP functions on my data as described below, but when I try to
> implement any of the two I obtain the error shown. I have looked the
> ?Summary.factor help but I have to admit I didn't quite understand it.
> Could anybody please help me with this error in order to know what I'm
> doing wrong?
>
> >rmadata2$Genotype
>
> [1] CONT CONT CONT VAV2 VAV2 VAV2
> Levels: CONT VAV2
>
> > Index1 <- which(rmadata2$Genotype=="CONT")
> > Index2 <- which(rmadata2$Genotype=="VAV2")
> > scores <- esApply (rmadata2, 1, function(x) {
>
> +       tmp <-t.test(x[Index2], x[Index1], var.equal =TRUE)
> +       c(mean(tmp$estimate), -diff(tmp$estimate), tmp$statistic,
> tmp$p.value)
> +  })
>
> > scores <- t(scores)
> > colnames(scores) <- c("a", "m", "t.test", "p.value")
> > sum(scores[, 4] <= 0.05)
>
> [1] 1130
>
> > sum(scores[, 4] <= 0.01)
>
> [1] 318
>
> > tmp <- mt.rawp2adjp(scores[,4])
> > adj.p.values <- tmp$adjp[order(tmp$index), -1]
> > scores <- cbind(scores, adj.p.values)
> > tmp <- mt.maxT(exprs(rmadata2), rmadata2$Genotype)
>
> Error in Summary.factor(..., na.rm = na.rm) :
>         "max" not meaningful for factors
>
> Thanks in advance for your help and sorry if this is not a relevant
> question for BioC,
> Fatima
>
> _______
>  
>
>  
> Fátima Núñez, PhD
> Centre for Cancer Research (CIC)
> University of Salamanca-CSIC
> Campus Unamuno
> 37007 Salamanca                                                  
> Spain
> Phone: + 34 923 294802
> Fax:     + 34 923 294743
> E-mail: fnunez at usal.es
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://www.stat.math.ethz.ch/mailman/listinfo/bioconductor

-- 
Ramón Díaz-Uriarte
Bioinformatics Unit
Centro Nacional de Investigaciones Oncológicas (CNIO)
(Spanish National Cancer Center)
Melchor Fernández Almagro, 3
28029 Madrid (Spain)
Fax: +-34-91-224-6972
Phone: +-34-91-224-6900

http://bioinfo.cnio.es/~rdiaz



More information about the Bioconductor mailing list