Install the R language on the linux system and install the mclust package

Please note that if you are the root account, you sudodo 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.

Please add a picture description

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:

insert image description here

Guess you like

Origin blog.csdn.net/qq_43369406/article/details/131807190