Code to create design matrix in de practical is unnecessarily complicated type <- sapply(strsplit(group, ".", fixed=T), function(x) x[1]) status <- sapply(strsplit(group, ".", fixed=T), function(x) x[2]) we already have these vectors in the dge object