官术网_书友最值得收藏!

  • Learning Shiny
  • Hernán G. Resnizky
  • 528字
  • 2021-07-09 21:46:08

About R

As stated on the R-project main website:

"R is a language and environment for statistical computing and graphics."

R is a successor of S and is a GNU project. This means, briefly, that anyone can have access to its source codes and can modify or adapt it to their needs. Nowadays, it is gaining territory over classic commercial software, and it is, along with Python, the most used language for statistics and data science.

Regarding R's main characteristics, the following can be considered:

  • Object oriented: R is a language that is composed mainly of objects and functions. Chapter 2, First Steps towards Programming in R, and Chapter 3, An Introduction to Data Processing in R, will cover object and function handling in R.
  • Can be easily contributed to: Similar to GNU projects, R is constantly being enriched by users' contributions either by making their codes accessible via "packages" or libraries, or by editing/improving its source code. There are actually almost 7000 packages in the common R repository, Comprehensive R Archive Network (CRAN). Additionally, there are other R repositories of public access, such as the bioconductor project which contains packages for bioinformatics.
  • Runtime execution: Unlike C or Java, R does not need compilation. This means that you can, for instance, write 2 + 2 in the console and it will return the value.
  • Extensibility: The R functionalities can be extended through the installation of packages and libraries. Standard proven libraries can be found in CRAN repositories and are accessible directly from R by typing install.packages().

Installing R

R can be installed in every operating system. It is highly recommended to download the program directly from http://cran.rstudio.com/ when working on Windows or Mac OS. On Ubuntu, R can be easily installed from the terminal as follows:

sudo apt-get update
sudo apt-get install r-base
sudo apt-get install r-base-dev

The installation of r-base-dev is highly recommended as it is a package that enables users to compile the R packages from source, that is, maintain the packages or install additional R packages directly from the R console using the install.packages() command.

To install R on other UNIX-based operating systems, visit the following links:

A quick guide to R

When working on Windows, R can be launched via its application. After the installation, it is available as any other program on Windows. When opening the program, a window like this will appear:

A quick guide to R

When working on Linux, you can access the R console directly by typing R on the command line:

A quick guide to R

In both the cases, R executes in runtime. This means that you can type in code, press Enter, and the result will be given immediately as follows:

> 2+2
[1] 4

The R application in any operating system does not provide an easy environment to develop code. For this reason, it is highly recommended (not only to write web applications in R with Shiny, but for any task you want to perform in R) to use an Integrated Development Environment (IDE).

The topics related to the R language are covered mainly in Chapter 2, First Steps towards Programming in R, and Chapter 3, An Introduction to Data Processing in R.

主站蜘蛛池模板: 长顺县| 福泉市| 岢岚县| 仁怀市| 遵义县| 德江县| 红桥区| 无极县| 宝兴县| 清镇市| 治县。| 丽江市| 沙雅县| 同心县| 弥渡县| 抚顺县| 繁峙县| 新蔡县| 龙陵县| 东丽区| 横峰县| 道真| 科技| 松潘县| 日喀则市| 利辛县| 彰化市| 泗阳县| 镇赉县| 长海县| 涟源市| 夹江县| 威远县| 方山县| 临城县| 海林市| 浪卡子县| 禄劝| 嘉义市| 平邑县| 合江县|