This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Plotting immunophenogram: Arguments implying different numbe rof rows error

I have encountered an error:

Error in data.frame(start = c(0, 2.5, 5, 7.5, 10, 15, seq(20, 39), 0,  : 
  arguments imply differing number of rows: 31, 30, 36

While im trying to plot an immunophenogram. The code that made the error is below. Please help!

data_a <- data.frame (start = c(0,2.5,5,7.5,10,15, seq(20,39),0,5,10,15,20), 
                      end = c(2.5,5,7.5,10,15, seq(20,40),0,5,10,15, 20), 
                      y1=c(rep(2.6,26),rep(0.4,4)),
                      y2=c(rep(5.6,26),rep(2.2,4)),
                      z=c(MIG[c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18)],
                          Activated_B_cell, Active_CD4_T_cell,Active_CD8_T_cell,
                          Effector_Memory_CD4_T_cell, Effector_Memory_CD8_T_cell, 
                          MDSC, Natural_Killer_cell, Neutrophil, Regulatory_T_cell, 
                          MHC, Immune_Checkpoint, Angiogenesis_Avastin_drug_response_marker,
                          Catalytic_Activity, Hypoxia_monitor, Immune_Response_Signature, 
                          Stimulatory_dentritic_cell_regulation, Tumor_Secretory_Cytokines, 
                          Wnt_signaling),
                      vcol=c(unlist(lapply(MIG[c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18)],mapcolors)), 
                             unlist(lapply(c(Activated_B_cell, Active_CD4_T_cell,Active_CD8_T_cell,Effector_Memory_CD4_T_cell, 
                                             Effector_Memory_CD8_T_cell, MDSC, Natural_Killer_cell, 
                                             Neutrophil, Regulatory_T_cell, MHC, Immune_Checkpoint, 
                                             Angiogenesis_Avastin_drug_response_marker, Catalytic_Activity, 
                                             Hypoxia_monitor, Immune_Response_Signature, 
                                             Stimulatory_dentritic_cell_regulation, 
                                             Tumor_Secretory_Cytokines, Wnt_signaling),
                                           mapbw))), 
                      label = c(unique_ips_genes[c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18)],
                                "Activated B cell","Active CD4 T cell","Active CD8 T cell",
                                "Effector Memory CD4 T cell", "Effector Memory CD8 T cell",
                                "MDSC", "Natural Killer cell", "Neutrophil", 
                                "Regulatory T cell", "MHC", "Immune Checkpoint", 
                                "Angiogenesis - Avastin drug response marker", 
                                "Catalytic Activity", "Hypoxia monitor", 
                                "Immune Response Signature", "Stimulatory dentritic cell regulation",
                                "Tumor Secretory Cytokines", "Wnt signaling")
                      )
immunophenogram r rna-seq

It is very difficult to read this code. Please format it (with the 01010101 code button), and add indentation and spacing.

1 answer

To simplify the problem:

myX = 1:3
myY = 1:4

data.frame(x = myX, y = myY)

# Error in data.frame(x = myX, y = myY) : 
#   arguments imply differing number of rows: 3, 4

Length of your columns are different, ensure every column has the same number of items.

length(myX)
# [1] 3
length(myY)
# [1] 4

Log in to answer this question.