How to generate boxplot

后端 未结 3 1314
-上瘾入骨i
-上瘾入骨i 2020-12-12 01:59

I have a data and from that, I want to generate boxplot. My file is saved in \"1.txt\" file and it seems like this

R  S1G1   S1G2   S2G1   S2G2
1  0.98   0.9         


        
3条回答
  •  醉酒成梦
    2020-12-12 02:26

    Maybe you want to reshape your data first:

    x1 <- reshape(x, idvar="R", varying=list(2:5), direction="long")
    

    And than plot it:

    boxplot(S1G1 ~ R, data=x1, main = "Output result",las = 2, pch=16, cex = 1,
        col = "lightblue", xlab = "R",ylab = "SNP values",ylim =c(-0.4,1.2), 
        border ="blue", boxwex = 0.3)
    

    boxplot

提交回复
热议问题