Chapter 1 R programming language | Numerical Methods Using R For Environmental Engineering - Asia B Technology

Chapter 1 R programming language | Numerical Methods Using R For Environmental Engineering

programming r

Nowadays there is poly once software that can be used to help us in doing data analysis. The software used can be paid or free software.

R is one of the free software that is very popular in Indonesia. The ease of use and the large amount of community support made R the most famous programming language error on the global basis.

The package provided for statistical analysis & numerical analysis is also very complete and continues to grow every time. This makes R poly used by data analysts.

In this chapter, the author will introduce to the reader about the R programming language, starting from history, how to install it to how we utilize the basic features of donation to dig further about the functions of R History R.

R is a language used in statistical computing that was first developed by Ross Ihaka and Robert Gentlement at the University of Auckland New Zealand which is an acronym based on the first names of the two creators. Before R was known there was an S developed by John Chambers and colleagues according to Bell Laboratories which had the same function for statistical computing. The difference between the two is that R is a free computing system. The R logo can be seen in Figure 1.1.

Figure 1.1: Logo R.

R is arguably a rich application of statistical systems. This is due to the many packages developed by the developer and the community for statistical analysis purposes such as linear regression, clustering, statistical tests, etc. In addition, R can also be spiked with other packages that can enhance its features.

As a programming language that is widely used for data analysis purposes, R can be operated in a variety of operating systems on personal computers. Supported operating systems include: UNIX, Linux, Windows, and MacOS. R Features & Characteristics

R has different characteristics using other programming languages such as C ++, python, etc. R has an out-of-sync budget / syntax using other programming languages that make it have its own characteristics compared to other programming languages.

Some of the characteristics and features of R include:R language is case sensitive. the meaning is that in the input process R uppercase and mini letters are very concerned. For example we want to see if objects A and B are in the following syntax:

## [1] FALSE

Everything contained in the R event will be considered to be an object. This object concept is the same as other object-based programming languages such as Java, C ++, python, etc.The difference is that R nisbi language is simpler than other obejk-based programming languages.

interpreted language or script. The R language allows users to perform work in R without the need to compile event code as a machine language.

Supports looping processes, decision making, & provides many types of operstors (arithmetic, logic, etc.).

Supports export & import of various archive formats, such as: TXT, CSV, XLS, etc.

Easily improved through the addition of functions or libraries. Package additions can be done online through CRAN or through origin for example github.

Provide various functions for data visualization purposes. programming r Data visualization in R can use built-in Plans or other Packages such as ggplo2, ggvis, etc.Advantages and Disadvantages of R

In addition to the R can be used perdeo there are still other advantages offered, including:Protability. The use of the application can be used at any time without being bound by the expiration of the license.

Multiplatform. R is Multiplatform Operating Systems, where R software is more compatible than other statistical applications. This has an impact on the ease of adjustment if the user must switch operating systems because R is good in the operating system such as windows will be the same operation using those on Linux (The same package used).

General and Cutting-edge. Various statistical methods both classical and new methods have been programmed into R. Thus this application can be used for statistical analysis with a classic approach and the latest approach.

Programable. Users can program new methods or develop modifications based on statistical analysis that is already contained in the R system.

Based on matrix analysis. R language is very good for programming on a matrix basis.

Complete graphic fasiltas.

The shortcomings based on R include:Point and Click GUI. Primary interaction with R is CLI (Command Line Interface), although currently a package has been developed that allows us to interact with R using a simple GUI (Graphical User Interface) using the R-Commander Package that has limited functionality. R-Commander itself is a GUI created using the purpose of pedagogy as a result of which the statistical analysis provided is a classic one. Although limited this package is useful if we need simple statistical analysis using practical means.

Missing statistical function. Although the statistical analysis in R is quite complete, but not all statistical methods have been implemented to R. But because R is the lingua franca for the purposes of modern statistical computing this staan, it can be said that the availability of additional functions in the form of packages is only a matter of time.RStudio

The R application is basically text-based or command line as a result of which the user is obliged to type exclusive commands and must memorize the commands. At least if we want to do data analysis activities using R we must always be ready with the commands to be used so that the manual book as something that must exist when working with R.

This condition is often a cause for novice users as well as advanced users who have become accustomed to the implementation of other statistics such as SAS, SPSS, Minitab, etc. That’s the reason that causes R developers to make various frontends for R which is useful to facilitate R operation.

RStudio is one form of R frontend that is relatively popular and comfortable to use. Besides being convenient to use, RStudio allows us to write reports using Rmarkdown or RNotebook and create a lot of project forms such as shyni, etc. In R studio also allows us to set up a working directory without the need to type syntax in the Commander, which is needed only select it in the RStudio dish. In addition, we can also import archives containing data without the need to type in Commander by selecting in the Environment dish.

In this tutorial will only be explained how to install R & RStudio in the windows operating system. Before starting to install try the reader to download the R & RStudio installer first.Run the installation process by clicking the R & RStudio application installer.

Follow the steps of the application installation process displayed using the OK or Next click.

If the installation has been done, run the installed application to test if the application is running properly.

The installed implementation window is displayed in Figure 1.two and Figure 1.three.

Figure 1.two: Window R.

Figure 1.3: RStudio Window.

Tip: We recommend installing R first before RStudio Working Directory

Each user will work on a special site that is considered a working directory. Working directory is a folder where R will read and save our work archive. In windows users, the working directory by default when first installing R is located in the folder c:\\Document. Changing the Location of the Working Directory

We can change the working directory location of the location we want, for example the location of the data that we will work without in the default folder or we want our work related to R can take place in one special folder.

close
Asi B Technology

Silahkan Subscribe untuk Mendapatkan Update Terbaru Sekitar Technology

We don’t spam! Read our privacy policy for more info.