报错集锦

作者: 养猪场小老板 | 来源:发表于2020-01-20 00:07 被阅读0次

    1、列的数目比列的名字要多

    image.png

    分析原因:表头列数小于实际列数。如下图


    image.png

    修改方法:读取的时候去掉表头

    > user1rotation2 <- read.csv(“G:\LabRealated\PublicDataset\CPS\data\user1\2\rotationvector.csv”,header = F)
    

    还有一种原因说是:可能是因为文本的编码不是utf-8造成的,解决方法:添加一条fileEncoding = "utf-8"

    > user1rotation2 <- read.csv(“G:\LabRealated\PublicDataset\CPS\data\user1\2\rotationvector.csv”,header = T, fileEncoding = "utf-8")
    

    2、分割符缺失

    > e1 <- read.table("dang.txt")
    Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  : 
      line 1 did not have 44 elements
    #解决办法,加上分隔符“\t”
    > e2 <- read.table("SraRunTable.txt",sep = "\t")
    

    3

    > dotplot(ego_cc,title="GO CC Enrichment")
    wrong orderBy parameter; set to default `orderBy = "x"`
    > pdf(file="CC_dot.pdf",width=10)
    > dotplot(ego_cc,title="GO CC Enrichment",orderBy = "GeneRatio")
    > dev.off()
    
    image.png

    相关文章

      网友评论

        本文标题:报错集锦

        本文链接:https://www.haomeiwen.com/subject/oibdzctx.html