Entering edit mode
I'm trying to use relevel to set the baseline to "WT" by specifying the reference level
Code should be placed in three backticks as shown below
keep <- rowSums(counts(ddsHTSeq)) >= 10
ddsHTSeq_filtered <- ddsHTSeq[keep,]
ddsHTSeq_filtered$Genotype <- relevel(ddsHTSeq_filtered$Genotype, ref = "WT")
> Error in relevel.default(ddsHTSeq_filtered$Genotype, ref = "WT") :
> 'relevel' only for (unordered) factors
The code before I did relevel is this. Did it fail to make factors?
The code you present does nothing to the Genotype column that you then try to
relevel
. So yes, it made a factor for the combined Age, Gentotype, Tissue group, but why do you think that would affect the Genotype column?To clarify, this line
adds a new 'group' column to your ddsHTSeq_filtered object by
paste
ing three existing columns together. But it doesn't do anything to those three other columns.Thanks for clarifying, this is very helpful!