[2023 latest version] R installation (direct + Anaconda) and use (Pycharm configuration R) tutorial

Table of contents

1. R language

1. R official website

2. Introduction to R

2. Install R directly

1. Download

2. Install

Three, Pycharm uses R

1. Install PyCharm

2. R Language for IntelliJ plugin

3. R ​​setup

report error

4. R package

Install

load

View installed packages

4. Use Anaconda to create an R language virtual environment

1. Install Anaconda

2. Create R language virtual environment


 

 

 

 

1. R language

1. R official website

R: The R Project for Statistical Computing (r-project.org)https://www.r-project.org/

 

2. Introduction to R

        R language is a programming language used for statistical computing and data analysis. It has rich data processing, statistical modeling and data visualization functions, and is widely used in data science, statistics, machine learning and other fields.

        The R language has powerful data processing and manipulation capabilities, and can handle data of various types and sizes. It provides a wealth of statistical methods and models, including common machine learning and statistical methods such as linear regression, logistic regression, decision tree, and cluster analysis. In addition, the R language has rich visualization functions, which can create various types of charts and visual displays.

        The R language has the support of the open source community, and there are a large number of open source packages and libraries available, which can expand the functions and application fields of R. In the R language community, you can find a wide variety of packages for data processing, statistical modeling, machine learning, natural language processing, and more.

        The R language has an easy-to-learn and easy-to-use syntax that is friendly to beginners in statistics and data analysis. At the same time, R is also scalable and repeatable, enabling automated analysis processes and report generation.

 

2. Install R directly

1. Download

The Comprehensive R Archive Network (tsinghua.edu.cn)https://mirrors.tuna.tsinghua.edu.cn/CRAN/

4c7b61e915914b68a13c7ae0b7f27247.png

372e7573d73c4f62a565aa5d4c410e90.png

fbd1d57e090f445ea860d3cb0ddf8f5b.png

 

2. Install

  • Choose where to install

025f3f736f79462a8f95f944ebe7ad51.png

  • custom components

78236cc9cd9a42cabea46cfdbdba2828.png

  •  disable self-start

758003d3b1154aeab6364fe8dc48d48c.png

  • menu folder name

a63dd21ef9db4ec7801d51a17d561442.png

 

Three, Pycharm uses R

1. Install PyCharm

Refer to the previous article:

PyCharm Professional Edition Installation Tutorial (using jetbrains toolbox management; student certification, Xuexin.com verification code application) =1001.2014.3001.5502

 

2.  R Language for IntelliJ plugin

  • File - Settings

156cd8d7eedc41e8bdbfa8bc667d4a71.png

  • plug-in

4d8bc74a97484900a006d6f5ca593e57.png

 

3. R ​​setup

 (automatic detection)e423a7ccd9fe4e868cfb881b2875173c.png

 8052443a64924f4bb62b231bad93e5ae.png

report error

 Warning in (function (file = "", n = NULL, text = NULL, prompt = "?", keep.source = getOption("keep.source"),  :
  argument encoding="UTF-8" is ignored in MBCS locales

If it is an eyesore, it will be an eyesore, it does not affect, you can modify it:

Sys.setlocale(category = 'LC_ALL', locale = 'English_United States.1252')

 

If you modify it, remember to change it back after not using R, otherwise the system will report other errors (such as: notice garbled characters)

Sys.setlocale("LC_ALL","Chinese")

 

4. R package

Install

install.packages("hdf5r")

load

library(hdf5r)

        After the package is loaded hdf5r, the functions and methods provided by it can be used.

View installed packages

installed_packages <- installed.packages()
package_names <- rownames(installed_packages)

print installed package names

print(package_names)

dd8b99ef18d74fcf830799a7e3d6dbb9.png

 

4. Use Anaconda to create an R language virtual environment

1. Install Anaconda

Refer to the previous article:

win11 install Anaconda ( 2022.10 ) + pycharm (2022.3/2023.1.4) + configure virtual environment

 

2.  Create R language virtual environment

conda create -n R4.1.3 r-base==4.1.3
conda activate R4.1.3
conda install r-seurat
library(Seurat)

 

 

 

 

 

Guess you like

Origin blog.csdn.net/m0_63834988/article/details/132449952