R language installation tutorial | Super detailed graphic introduction

R language installation tutorial | Super detailed graphic introduction

1 Introduction to R language


1.1 History of the R language

The R language comes from the S language and is a variant of the S language. The S language was developed by Rick Becker, John Chambers and others at Bell Labs. The famous C language and Unix system were also developed by Bell Labs. R is a free software, GPL licensed, originally released in 1997 by Ross Ihaka and Robert Gentleman of the University of Auckland, New Zealand. R implements basically the same functions and statistical functions as the S language. It is now developed by the R core team, but users around the world can contribute packages.

1.2 Features of R language
  • Free software, free , open source code, supports currently popular major systems
  • Isn’t this feature enough? ! ! ! (What kind of bicycle do you want ( ̄△ ̄;))
1.3 Recommended books

I haven’t read any of them, ( ̄ー ̄)

  1. Hadley Wickham and Garrett Grolemund(2017) “R for Data Science” https://r4ds.had.co.nz/
  2. Hadley Wickham(2019) “Advanced R,” 2nd ed. https://adv-r.hadley.nz/
  3. Hadley Wickham(2016) ggplot2 Elegant Graphics for Data Analysis, 2nd ed.https://ggplot2-book.org/

3 Download and install R


This time, taking mac os (m1) as an example, open

https://www.r-project.org/

3.1 Select a new version of R


3.2 Select Tsinghua Mirror


3.3 Choose different versions of R according to different operating systems. Here I choose mac os.


3.4 Since mac has different chip issues, m1 and intel, you can choose different versions according to the chip.

Note! Let me remind you that if you need to frequently use the packages on Bioconductor for biochemical analysis, even if you are an M1 user, it is recommended that you choose the intel version of R.


3.5 Finally, rush all the way to the end, and the installation is complete~

4 Download and install RStudio


After installing the R language, you can install RStudio. Rstudio is an IDE for R. It has powerful graphics functions and can use R more conveniently. R is like the body of a camera, and Rstudio is like the lens of a camera. You can buy expensive lenses. It's cheap, but it has to be used on this camera body.

4.1 Open Rstudio official website

https://www.rstudio.com/products/rstudio/


4.2 Download Rstudio Desktop, of course it is the free version


4.3 Select the corresponding version corresponding to your operating system. Here I choose the mac version.


4.4 After downloading, just race all the way to the end.

5 R studio interface introduction


  • A: Scripting area. The R code written in this area can be deleted and modified. Click "run" to run a single command, click "source" to run all edited commands. Commonly used shortcut keys: command+ return(If you are interested in knowing all the shortcut keys, you can use option++ to view)shiftk
  • B: Data display area. Display historical data entered in R.
  • C: Command execution area. The results and errors of the code execution will be displayed in this area.
  • D: Drawing and help area.

6 Basic settings


Don’t rush to write code first, do some basic settings first

6.1 Click Tools -> Global Options

(Mac shortcut command+ ,)


6.2 Working directory

By Browseselecting the default working path, it is recommended that you set the working directory by setwd()or creating a new one.project


6.3 Set theme

Just pass font sizeand themeset it to the font size and theme you like. Everyone has their own preferences (O_o)(o_O)


6.4 Set up mirroring

By changechoosing the mirror address closest to you


Finally, I wish you all a speedy recovery!~

Click to watch, the official account replies rstudioto get the pdf version of all Rstudio shortcut keys

Guess you like

Origin blog.csdn.net/m0_72224305/article/details/125984030