Please note that if you are the root account, you sudo
do not need to add all of them.
x.1 Install the R language
It is recommended to use Tsinghua source to install R language, linkhttps://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/linux/ubuntu/
Just enter the following string of codes in the terminal, and it is recommended to install all 5000+ R packages.
x.2 Install the mclust package
A bunch of errors were reported at the beginning of the installation of the mclust packageERROR: compilation failed for package 'mclust'
Take a closer look at g++ and errors, enter the following code to install g++ and other packages,
sudo apt-get install gfortran
Type R in the terminal to enter the interactive interface of R,
R
Then enter the following codes in order to install the mclust package,
# 安装
install.packages("mclust")
# 加载
library(mclust)
The result of the operation is as follows, the installation is successful: