R Language Tutorial

R 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 is not an ideal choice; you can choosePython、CorJava。

Both R and C are research results from Bell Laboratories, but they focus on different areas. R is an interpreted language oriented towards mathematical theory researchers, while C is designed for computer software engineers.

R is an interpreted language (unlike C's compiled execution), and its execution speed is much slower than C, which is not conducive to 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 statistics.

R 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 designed for software programmers who need to learn R from scratch.

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

R Language Features

  • R 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 vectors, matrices, factors, datasets, and other common data structures.
  • 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 the free software GNU Octave and the commercial software MATLAB, which are dedicated to matrix computation.

Compile/Execute R Programs

Example (helloworld.R)

myString <- "Hello, World!"

print ( myString )

Run example »

The R language file suffix is.R, 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 Scripts 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