Dear all,
I am trying edgeR to detect DE gene for my time course data. I have one experimental condition with 4 time point, But while using design matrix its give me a error.
My code is: (in short:)
> label
[1] WT WT WT WT WT WT WT WT WT WT WT WT WT WT WT WT WT
Levels: WT
> Time
[1] T1 T1 T1 T1 T1 T1 T2 T2 T2 T2 T3 T3 T3 T3 T4 T4 T4
Levels: T1 T2 T3 T4
# Before we fit GMLs, we need to define our design matrix
design <- model.matrix (~Time + label)
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
Any advice? Thanks in advance guys
As Devon say below label serves no purpose, when trying to generate the design.matrix you need more than one level, other wise R cannot create the model representation.