Error in DESeqDataSetFromHTSeqCount

I am using HTseq pipeline for DESeq2:

Directory = "/Users/abhaykanodia/Desktop/smallRNA/"

condition = c("WT1", "WT2", "WT3",
              "NTC1", "NTC2", "NTC3)

sampleFiles= c("AK1a_counts.txt","AK2a_counts.txt","AK3a_counts.txt","
AK4a_counts.txt","AK5a_counts.txt","AK6a_counts.txt")

sampleName = c("AK1", "AK2", "AK3", "AK4", "AK5", "AK6")

sampleTable <- data.frame(sampleName = sampleName, fileName = sampleFiles, condition = condition)
sampleTable

The output is:

sampleName         fileName           condition
1         AK1  AK1a_counts.txt                 WT1
2         AK2  AK2a_counts.txt                 WT2
3         AK3  AK3a_counts.txt                 WT3
4         AK4  AK4a_counts.txt                NTC1
5         AK5  AK5a_counts.txt                NTC2
6         AK6  AK6a_counts.txt                NTC3

Now, when I use:

ddsHTSeq <- DESeqDataSetFromHTSeqCount(sampleTable = sampleTable,
                                       directory = Directory,
                                       design= ~ condition)

It gives the following error:

Error in `colnames<-`(`*tmp*`, value = sampleTable[, 1]) : 
  attempt to set 'colnames' on an object with less than two dimensions

Read more here: Source link