R Language Tutorial

R language is a mathematical programming language designed for mathematical researchers, mainly used for statistical analysis, plotting, and data mining.

If you are a beginner in computer programming and are eager to learn general-purpose programming, R language is not an ideal choice. You can choosePython、CorJava。

Both R language and C language are research achievements of Bell Labs, but they focus on different areas. R language is an interpreted language oriented toward mathematical theory researchers, while C language is designed for computer software engineers.

R language is an interpreted language (unlike C language, which is compiled and run), and its execution speed is much slower than C language, making it less suitable for optimization. However, it provides richer data structure operations at the syntax level and can very conveniently output text and graphical information, so it is widely used in mathematics, especially in statistics.

R language official website:https://cran.r-project.org/

Official mirror site list:https://cran.r-project.org/mirrors.html

Who is this tutorial for?

This tutorial is specially created for software programmers who need to learn R language from scratch.

If you are a very experienced R language user, you can still get syntax references from this tutorial, but the tutorial itself may not contain content that solves your deeper problems.

R Language Features

  • The R language environment software is GNU open-source software, with good compatibility and free to use
  • The syntax is very conducive to complex mathematical operations
  • Rich data types, including common data structures such as vectors, matrices, factors, and data sets
  • Good code style and strong readability

Although R is mainly used for statistical analysis or developing statistics-related software, some people also use it for matrix computation. Its analysis speed is comparable to GNU Octave, a free software dedicated to matrix computation, and the commercial software MATLAB.

Compile/Execute R Programs

Example (helloworld.R)

myString <- "Hello, World!"

print ( myString )

Run Example »

R language file suffix is.R, and you can use the command-line toolRscriptto execute R script files.

Execute the above script:

Rscript helloworld.R
R Programming Basic Knowledge Points Script suffix, execution method, core syntax, data analysis ecosystem R 1. R Script Files hello.R The suffix of R script files is usually .R 2. Execute R Script Rscript hello.R The most common command-line execution method 3. Basic Syntax x <- c(1,2,3) x * 2 [1] 2 4 6 4. Core Advantages of R Data Analysis · Statistics · Visualization · Scientific Computing R Language - WWW.example.com

References

Other Extensions