Error in names(x) <- value in R studio

27 views
Skip to first unread message

Aanuoluwa Adekoya

unread,
Dec 1, 2022, 5:37:51 PM12/1/22
to SAMSA bioinformatics group
Hi Sam,

I have been looking for ways to fix my issue since the command line seem to not be working for me. I took the files and scripts to R studio and when I try to run deseq_stats, I get the error below:

Error in names(x) <- value :
  'names' attribute [3] must be the same length as the vector [1]

When I tried to open the script t run it lines by line in R; I noticed that block, where I read in the files, is where the error is:

# READ IN FILES
# loading the control table
y <- 0
for (x in control_files) {
  y <- y + 1
  if (y == 1) {
    control_table <- read.table(file = x, header = F, quote = "", sep = "\t")
    colnames(control_table) = c("DELETE", x, "V3")
    control_table <- control_table[,c(3,2)]      }
  if (y > 1) {
    temp_table <- read.table(file = x, header = F, quote = "", sep = "\t")
    colnames(temp_table) = c("DELETE", x, "V3")
    temp_table <- temp_table[,c(2,3)]
    control_table <- merge(control_table, temp_table, by = "V3", all = T)  }
}



Please help. I have been on this analysis for weeks. Thanks. 

Aanuoluwa.

Aanuoluwa Adekoya

unread,
Dec 2, 2022, 1:31:31 AM12/2/22
to SAMSA bioinformatics group
Hi Sam,

I fixed all of my problems. Thanks!

Reply all
Reply to author
Forward
0 new messages