Basics in R Programming Language and RStudio

Wishlist Share
Share Course
Page Link
Share On Social Media

About Course

R

R is a programming language and free software environment for statistical computing and graphics supported by the R Foundation for Statistical Computing. The R language is widely used among statisticians and data miners for developing statistical software and data analysis Polls, data mining surveys, and studies of scholarly literature databases show substantial increases in popularity; as of January 2021, R ranks 9th in the TIOBE index, a measure of popularity of programming languages

A GNU package, the official R software environment is written primarily in C, Fortran, and R itself (thus, it is partially self-hosting) and is freely available under the GNU General Public License. Pre-compiled executable are provided for various operating systems. Although R has a command line interface, there are several third-party graphical user interfaces, such as RStudio, an integrated development environment, and Jupyter, a notebook interface.

Statistical features

R and its libraries implement various statistical and graphical techniques, including linear and nonlinear modelling, classical statistical tests, spatial and time-series analysis, classification, clustering, and others. R is easily extensible through functions and extensions, and the R community is noted for its active contributions in terms of packages. Many of R’s standard functions are written in R itself, which makes it easy for users to follow the algorithmic choices made. For computationally intensive tasks, C, C++, and FORTRAN code can be linked and called at run time. Advanced users can write C, C++,Java, .NET or Python code to manipulate R objects directly. R is highly extensible through the use of user-submitted packages for specific functions or specific areas of study. Due to its S heritage, R has stronger object-oriented programming facilities than most statistical computing languages. Extending R is also eased by its lexical scoping rules

Another strength of R is static graphics, which can produce publication-quality graphs, including mathematical symbols. Dynamic and interactive graphics are available through additional packages.

R has Rd, its own LaTeX-like documentation format, which is used to supply comprehensive documentation, both online in a number of formats and in hard copy

Programming features

R is an interpreted language; users typically access it through a command-line interpreter. If a user types 2+2 at the R command prompt and presses enter, the computer replies with 4, as shown below:

> 2 + 2

[1] 4

This calculation is interpreted as the sum of two single-element vectors, resulting in a single-element vector. The prefix  indicates that the list of elements following it on the same line starts with the first element of the vector (a feature that is useful when the output extends over multiple lines).

Like other similar languages such as APL and MATLAB, R supports matrix arithmetic. R’s data structures include vectors, matrices, arrays, data frames (similar to tables in a relational database) and lists. Arrays are stored in column-major order. R’s extensible object system includes objects for (among others): regression models, time-series and geo-spatial coordinates. The scalar data type was never a data structure of R. Instead, a scalar is represented as a vector with length one.

Many features of R derive from Scheme. R uses S-expressions to represent both data and code. Functions are first-class and can be manipulated in the same way as data objects, facilitating meta-programming, and allow multiple dispatch. Variables in R are lexically scoped and dynamically typed. Function arguments are passed by value, and are lazy—that is to say, they are only evaluated when they are used, not when the function is called.

R supports procedural programming with functions and, for some functions, object-oriented programming with generic functions. A generic function acts differently depending on the classes of arguments passed to it. In other words, the generic function dispatches the function (method) specific to that class of object. For example, R has a generic print function that can print almost every class of object in R with a simple print(objectname) syntax.

Although used mainly by statisticians and other practitioners requiring an environment for statistical computation and software development, R can also operate as a general matrix calculation toolbox – with performance benchmarks comparable to GNU Octave or MATLAB.

R Studio

RStudio is an integrated development environment (IDE) for R, a programming language for statistical computing and graphics. It is available in two formats: RStudio Desktop is a regular desktop application while RStudio Server runs on a remote server and allows accessing RStudio using a web browser.

Packages

In addition to the RStudio IDE, RStudio PBC and its employees develop, maintain, and promote a number of R packages. These include:

  • Tidyverse – R packages for data science, including ggplot2, dplyr, tidyr, and purrr
  • Shiny – An interactive web technology
  • RMarkdown – Markdown documents make it easy for users to mix text with code of different languages, most commonly R. However, the platform supports mixing R with Python, shell scripts, SQL, Stan, JavaScript, CSS, Julia, C, Fortran, and other languages in the same RMarkdown document.
  • flexdashboard – publish a group of related data visualizations as a dashboard
  • Tensor Flow – open-source software library for Machine Intelligence. The R interface to TensorFlow lets you work productively using the high-level Keras and Estimator APIs and the core TensorFlow API
  • Tidymodels – install and load tidyverse packages related to modeling and analysis
  • Sparklyr – provides bindings to Spark’s distributed machine learning library. Together with sparklyr’s dplyr interface, you can easily create and tune machine learning workflows on Spark, orchestrated entirely within R
  • Stringr – consistent, simple and easy-to-use set of wrappers around the ‘stringi’ package
  • Reticulate – provides a comprehensive set of tools for interoperability between Python and R.
  • Plumber – enables you to convert your existing R code into web APIs by merely adding a couple of special comments.
  • knitr – Dynamic reports combining R, TeX, Markdown & HTML
  • packrat – Package dependency tool
  • devtools – Package development tool as well as helps to install R-packages from GitHub.
  • sf – supports for simple features, a standardized way to encode spatial vector data. Binds to ‘GDAL’ for reading and writing data, to ‘GEOS’ for geometrical operations, and to ‘PROJ’ for projection conversions and datum transformations.

Addins

The RStudio IDE provides a mechanism for executing R functions interactively from within the IDE through the Addins menu. This enables packages to include Graphical User Interfaces (GUIs) for increased accessibility. Popular packages that use this feature include:

  • bookdown – a knitr extension to create books
  • colourpicker – a graphical tool to pick colours for plots
  • Load – a graphical tool to search and load datasets
  • googleAuthR – Authenticate with Google APIs

Thanks to Rodney Anderson, Computer Programmer

Source : – www.everthyingcomputerscience.com

Download R: https://cran.r-project.org

Download RStudio: https://www.rstudio.com

Show More

What Will You Learn?

  • Learners will understand about RStudio and R Programming Language

Course Content

Install R and RStudio On Windows

  • Install R and RStudio On Windows
    04:47

R Programming Basic Operators

Variable Assignment And Data Types In R Programming

R Programming Vector Arithmetic

R Programming Vector Index

R Programming Vectors

R Programming Numeric Index Vector

R Program Named Vector Members

Create a Matrix in R

Linear Regression R Program Make Predictions

How To Install R Packages

R Program Bar Graph

R Program Bar Chart Color

R Programming Histogram Example

R Programming Subset

R Program Subset2

Read CSV File In R

Reading JSON R Programming

Multiple Linear Regression In R

SQL Select Statements Using NBA Data In R

Twitter Mining Extracting Tweets In R

Sentiment Analysis R Programming