美文网首页
R languge correlation plot

R languge correlation plot

作者: ab02f58fd803 | 来源:发表于2021-01-13 11:58 被阅读0次

    R语言关于相关性的热度图绘制

    # reference:https://cran.r-project.org/web/packages/corrplot/vignettes/corrplot-intro.html
    # https://github.com/taiyun/corrplot
    # install in R: install.packages("corrplot")
    library(corrplot)
    
    #corrplot 0.84 loaded
    # 载入原始文件
    M <- cor(mtcars)
    
    # 保存文件pdf
    pdf(file = "yourfilename.pdf")
    # 绘制图 number.cex 改数字字体大小
    corrplot(M, method = "circle",  type = "upper" ,title = "correlation",
    mar = c(0,0,1,0), number.cex = 0.5, number.digits = 2)
    dev.off()
    
    image.png

    相关文章

      网友评论

          本文标题:R languge correlation plot

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