Hi,
I'm trying to do GO enrichment analysis using topgo, but i've encountered a problem, read below. what does factor w/ level 1 mean? it says that i should have 2 level factors. how can I fix this?
> myInterestingGenes <- as.vector(AvsB$genes)
> geneList <- factor(as.integer(geneNames %in% myInterestingGenes))
> names(geneList) <- geneNames
> names
function (x) .Primitive("names")
> str(geneList)
Factor w/ 1 level "0": 1 1 1 1 1 1 1 1 1 1 ...
- attr(*, "names")= chr [1:18756] "Genes" "c10020_g1" "c10035_g1" "c10052_g1" ...
Error in .local(.Object, ...) : allGenes must be a factor with 2 levels
I'm trying to do GO enrichment analysis using topgo, but i've encountered a problem, read below. what does factor w/ level 1 mean? it says that i should have 2 level factors. how can I fix this?
> myInterestingGenes <- as.vector(AvsB$genes)
> geneList <- factor(as.integer(geneNames %in% myInterestingGenes))
> names(geneList) <- geneNames
> names
function (x) .Primitive("names")
> str(geneList)
Factor w/ 1 level "0": 1 1 1 1 1 1 1 1 1 1 ...
- attr(*, "names")= chr [1:18756] "Genes" "c10020_g1" "c10035_g1" "c10052_g1" ...
Error in .local(.Object, ...) : allGenes must be a factor with 2 levels
Comment