Dear limma-maintainer,

Firstly, thank you for providing limma, it has helped our work a lot.

Now, I am not sure whether this is the right address for this observation.
I noticed that when calculating only one contrast, e.g.,

design2<-model.matrix(~ -1 + tgt);
cont.matrix<-makeContrasts(PvsC=tgtpedicel-tgtcapitellum, levels=design2);
fit2<-lmFit(eset,design2);
cfit2<-contrasts.fit(fit2,cont.matrix);
cfit2.eb<-eBayes(cfit2);

that this single contrast cannot be named in topTable:

topTable(cfit2.eb,coef=1);     # works
topTable(cfit2.eb,coef="PvsC");     # **broken**

giving

Error in toptable(fit = fit[c("coefficients", "stdev.unscaled")], coef =
coef,  :
    subscript out of bounds

when a second contrast is added to cont.matrix, the problem disappears.

I suspect that this is caused by a one-column matrix being implicitly
converted to a vector by R somewhere in toptable.

While it is easy to work around the problem and one will probably only
encounter it in rare situations, stumbling over it can confuse amd so I
wanted to point out the issue.

Yours sincerely,

David.

(Boku University, Vienna)

	[[alternative HTML version deleted]]

