Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

R Language Tutorial

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 eager to learn general-purpose programming, R is not an ideal choice; you can choose Python、C or Java。

Both R and C are products of Bell Labs, but they focus on different areas. R is an interpreted language aimed at mathematical researchers, while C was designed for computer software engineers.

R is an interpreted language (unlike C, which is compiled), and it runs much slower than C, which is not conducive to optimization. However, it provides richer data structure operations at the syntax level and makes it very convenient to output text and graphics, so it is widely used in mathematics, especially statistics.

Official R website:https://cran.r-project.org/

List of official mirror sites:https://cran.r-project.org/mirrors.html

Who should read this tutorial?

This tutorial is designed specifically for software programmers who need to learn R from scratch.

If you are a very experienced R user, you can still use this tutorial as a syntax reference, but the tutorial itself may not contain material that solves your deeper problems.

Features of R

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

Compiling/executing R programs

Example (helloworld.R)

myString

<-

"Hello, World!"

print

(

myString

)

Run Example »

R files use the .R extension; you can use the command-line tool Rscript to execute R script files.

Execute the above script:


Rscript helloworld.R
Key points of R Programming basics Script extensions, running methods, core syntax, and the data analysis ecosystem R 1. R script files hello.R R script files usually have the .R extension 2. Executing R scripts Rscript hello.R The most common command-line running 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.RUNOOB.COM

References