当前位置:网站首页>R statistical plot - correlation of environmental factors +mantel test combination diagram (linket package introduction 1)

R statistical plot - correlation of environmental factors +mantel test combination diagram (linket package introduction 1)

2022-06-21 06:02:00 Silent voice

linkET yes ggcor The author's new bag , Most commonly used for plotting combined with correlation analysis +mantel test Draw a correlation combination diagram . But he also draws random forests 、 Heat map and other functions , The drawing is also very beautiful . The following articles will introduce linkET Use of the bag . The first part introduces the most used functions - Draw a correlation combination diagram .

1. Data preparation

# 1.1  Set work path 
#knitr::opts_knit$set(root.dir="D:\\EnvStat\\linkET")#  Use Rmarkdown Run the program 
Sys.setlocale('LC_ALL','C') # Rmarkdown Global settings 
options(stringsAsFactors=F)# R Environment variable settings in , Prevent character variables from being converted to factors 
setwd("D:\\EnvStat\\linkET")

# 1.2  Read in environmental factors 、otu And metabolic data 
#library(devtools)
#install_github('Hy4m/linkET',force = TRUE) #  Installation package 
library(linkET)
ls("package:linkET") #  View all function names in the package 
#mget(ls("package:linkET"), inherits = TRUE) #  Check the function name and source code 
library(ggplot2)
library(dplyr)

# otu data 
otu = read.csv("otu.csv",row.names = 1,stringsAsFactors = FALSE,check.names = FALSE)
head(otu)

#  Metabolome data 
met = read.csv("met.csv",row.names = 1,stringsAsFactors = FALSE,check.names = FALSE)
head(met)

#  Environmental factors 
原网站

版权声明
本文为[Silent voice]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206210550434814.html