Entering edit mode
During performing analysis of my data, I got an error while designing the matrix. please help me out.
Here is the code that I run
# condition_pairs <- t(combn(levels(HB$Treatment), 2))
Error in combn(levels(HB$Treatment), 2) : n < m
# Here is my metadata named HB
Run collection_time Sample Name Treatment
SRR1984269 24h post-plating GSM1663548 Uninfected
SRR1984270 48h post-plating GSM1663549 Uninfected
SRR1984275 72h post-plating GSM1663554 Uninfected
SRR1984276 48h post-plating/24h post-infect GSM1663555 AdGFP-infected
SRR1984279 48h post-plating/24h post-infect GSM1663558 AdHBV-infected
SRR1984281 48h post-plating/24h post-infect GSM1663560 AdHBV-infected
SRR1984285 72h post-plating/48h post-infection GSM1663564 AdHBV-infected
SRR1984271 48h post-plating GSM1663550 Uninfected
SRR1984282 72h post-plating/48h post-infection GSM1663561 AdGFP-infected
SRR1984284 72h post-plating/48h post-infection GSM1663563 AdGFP-infected
SRR1984266 Freshly isolated/unplated GSM1663545 Uninfected
SRR1984280 48h post-plating/24h post-infect GSM1663559 AdHBV-infected
SRR1984265 Freshly isolated/unplated GSM1663544 Uninfected
SRR1984267 Freshly isolated/unplated GSM1663546 Uninfected
SRR1984268 24h post-plating GSM1663547 Uninfected
SRR1984272 48h post-plating GSM1663551 Uninfected
SRR1984283 72h post-plating/48h post-infection GSM1663562 AdGFP-infected
SRR1984286 72h post-plating/48h post-infection GSM1663565 AdHBV-infected
SRR1984287 72h post-plating/48h post-infection GSM1663566 AdHBV-infected
SRR1984273 72h post-plating GSM1663552 Uninfected
SRR1984274 72h post-plating GSM1663553 Uninfected
SRR1984277 48h post-plating/24h post-infect GSM1663556 AdGFP-infected
SRR1984278 48h post-plating/24h post-infect GSM1663557 AdGFP-infected
Can you tell us the output of
class(HB$Treatment)
? It should be "factor"The output of class
HB($Treatment)
[1] "character"
Try
class(HB$Treatment) <- "factor"
and combn should workyou mean the code should be
You should precise what is your expected output in your post as it is difficult to help you. If you want to remove the error you could do :
condition_pairs <- t(combn(unique(HB$Treatment), 2))