[BioC] Problem of combine function when combining different numeric types

Martin Morgan mtmorgan at fhcrc.org
Thu Dec 4 18:35:06 CET 2008

Hi Pan ---

Pan Du <dupan at northwestern.edu> writes:

> Hi Martin,
> I am not sure who I should contact with for this problem. I just send this
> to you. The problem is: when I try to combine two numeric types (integer and
> double) of matrix (actually they are in the assayData of ExpressionSet), the
> combine function reports error. For example:
>   a = matrix(rnorm(10), 2)
>   # set rownames and colnames because combine function require it.
>   colnames(a) = LETTERS[1:5]; rownames(a) = 1:2
>   b = matrix(1:10, 2)
>   colnames(b) = LETTERS[6:10]; rownames(b) = 1:2
>   combine(a, b)
>> Error in combine(a, b) : matrix types double, integer differ

I changed this in the devel branch of Bioconductor, which should be
available to users of R-devel with biocLite after noon tomorrow
(Friday) Seattle time.

It's worth determining why your matricies have different 'typeof', and
fixing this up-stream if appropriate -- are the values meant to be
discrete and hence integer-valued, or continuous and hence numeric?
I've made the change somewhat reluctantly, as it changes what the
function does from 'combine' to 'coerce-and-combine'.


> I suppose the combine function should automatically convert the integer as
> double before combining them because this situation can be met very often.
> What's your suggestion? Thanks!
> Have a nice day!
> Pan
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor

Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M2 B169
Phone: (206) 667-2793

More information about the Bioconductor mailing list