Computer Science

R Programming Language

R is a programming language and environment commonly used for statistical computing and graphics. It provides a wide variety of statistical and graphical techniques, making it a popular choice for data analysis and visualization. With its extensive library of packages and active community support, R is widely used in academia and industry for data science and statistical analysis.

Written by Perlego with AI-assistance

7 Key excerpts on "R Programming Language"

Index pages curate the most relevant extracts from our library of academic textbooks. They’ve been created using an in-house natural language model (NLM), each adding context and meaning to key research topics.
  • Business Statistics with Solutions in R
    • Mustapha Abiodun Akinkunmi(Author)
    • 2019(Publication Date)
    • De Gruyter
      (Publisher)
    2  Introduction to R Software
    R is a programming language designed for statistical analysis and graphics. It is based on S-plus which was developed by Ross Ihaka and Robert Gentleman from the University of Auckland, New Zealand. R can be used to open multiple datasets. R is open-source software that can be downloaded at http://cran.r-project.org/ . There are other statistical packages—SPSS, SAS, and Stata—but they are not open source. In addition, there are large R user groups online that can provide real-time answers to questions and that also contribute packages to R. Packages increase the functions that are available for use in R, thus expanding the users’ capabilities. The R Development Core Team is responsible for maintaining the source code of R. This chapter covers a lot of ground, but it is impossible to document R in a chapter and so we provide explanations and examples of the significant statistical functions. The R code is provided in many examples throughout this book.
    Why turn to R?
    R software provides the following advantages:
    1. R is free (meaning it is open-source software).
    2. Any type of data analysis can be executed in R.
    3. R includes advanced statistical procedures not yet present in other packages.
    4. The most comprehensive and powerful feature for visualizing complex data is available in R.
    5. Importing data from a wide variety of sources can be easily done with R.
    6. R is able to access data directly from web pages, social media sites, and a wide range of online data services.
    7. R software provides an easy and straightforward platform for programming new statistical techniques.
    8. It is easy to integrate applications written in otheR Programming Languages (such as C++, Java, Python, PHP, Pentaho, SAS, and SPSS) into R.
    9. R can operate on any operating system such as Windows, Unix, and Mac OSX. It can also be installed on an iPhone. It is possible to use R on an Android phone (see https://selbydavid.com/2017/12/29/r-android/
  • Applied Statistics for Environmental Science with R
    • Abbas F. M. Al-Karkhi, Wasin A. A. Alqaraghuli(Authors)
    • 2019(Publication Date)
    • Elsevier
      (Publisher)
    R is a software environment for statistical computing and graphical programming languages. The R software has been employed by professionals at various organizations, colleges, survey institutions, and others. Considerable statistical packages are provided for various statistical analyses; however, researchers, scientists, and others who are concerned in data analysis, designing, modeling, and producing beautiful and high-resolution plots prioritize employing R. R is offered for free as an open-source software; under the terms of the GNU General Public License, “R is an official part of the Free Software Foundation's GNU project, and the R Foundation has similar objectives to other open-source software foundations like the Apache Foundation or the GNOME Foundation.” R language is similar to the S language and environment that was developed by Bell Laboratories. R is employed by millions of researchers around the world, and the number of R users continues to increase. R has become a substantial, engaging, singular, and new statistical software for the following purposes:
    •  
      R is free (open-source) software including many packages, and many sources around the world permit downloading and installation of the software, regardless of the position and the institution you work with, or whether you are affiliated with a public or private organization.
    •  
      R offers many built-in functions to help make the steps of the analysis simple and easy. We can carry out data analysis in R by providing scripts to know the required variables and asking built-in functions in R to carry out the required process, such as computing the correlation, average, variance, or other statistical values.
  • Probability, Statistics, and Data
    eBook - ePub

    Probability, Statistics, and Data

    A Fresh Approach Using R

    Data in R
    DOI: 10.1201/9781003004899-1
    The R Statistical Programming Language plays a central role in this book. While there are several otheR Programming Languages and software packages that do similar things, we chose R for several reasons:
    1. R is widely used among statisticians, especially academic statisticians. If there is a new statistical procedure developed somewhere in academia, chances are that the code for it will be made available in R. This distinguishes R from, say, Python.
    2. R is commonly used for statistical analyses in many disciplines. Other software, such as SPSS or SAS is also used and in some disciplines would be the primary choice for some discipline specific courses, but R is popular and its user base is growing.
    3. R is free. You can install it and all optional packages on your computer at no cost. This is a big difference between R and SAS, SPSS, MATLAB, and most other statistical software.
    4. R has been experiencing a renaissance. With the advent of the tidyverse and RStudio, R is a vibrant and growing community. We also have found the community to be extremely welcoming. The R ecosystem is one of its strengths.
    In this chapter, we will begin to see some of the capabilities of R. We point out that R is a fully functional programming language, as well as being a statistical software package. We will only touch on the nuances of R as a programming language in this book.

    1.1 Arithmetic and variable assignment

    We begin by showing how R can be used as a calculator. Here is a table of commonly used arithmetic operators.
    TABLE 1.1: Basic arithmetic operators in R.
    Operator Description Example
    + addition 1 + 1
    - subtraction 4 - 3
    * multiplication 3 * 7
    / division 8 / 3
    ^ exponentiation 2^3
    The output of the examples in Table 1.1 is given below. Throughout the book, lines that start with ## indicate output from R commands. These will not show up when you type in the commands yourself. The [1] in the lines below indicate that there is one piece of output from the command. These will
  • Statistics in Environmental Sciences
    • Valerie David(Author)
    • 2019(Publication Date)
    • Wiley-ISTE
      (Publisher)
    1
    Working with the R Software1

    1.1. Working with the R software

    1.1.1. Why and how to work with the R software?

    The R software is both a computeR Programming Language and a working environment for statistical data processing. It is used to manipulate data, plot graphs and perform statistical analyses on these data. Among its advantages, R is:
    • – a “free” software that can be downloaded and installed on personal computers;
    • – a “cross-platform” software that runs on Windows, Linux, Mac OS, etc.
    As a result, many scientists use it internationally and do not hesitate to share their statistical knowledge by developing new functions and communicating through forums. Everyone can contribute to its improvement by integrating new functionalities or analysis methods that have not yet been implemented.
    This therefore makes it a software that is in rapid and constant evolution. Thus, many statistical analyses that are both simple and complex are available (descriptive and inferential statistics, parametric or non-parametric tests, linear or nonlinear models, multivariate analyses, etc.). No commercial software is able to provide such a choice of methods. It also has many useful and professional-quality graphic functions. Lastly, the tool is very effective because, when we master the R language, we are able to create our own tools (or “scripts”). This makes it possible to perform very sophisticated analyses by writing a script with a series of functions on the data (functions that are already incremented or created by ourselves) and to reproduce them very quickly on other data sets. In this book, we will be using the integrated development environment “Rstudio”, which is more user-friendly and powerful.
    It should be noted that not all functions are available in the basic software and that it will often be necessary to use additional libraries (or packages) that are also free. For example, the MASS package. When first used, the installation of the package requires an Internet connection. There are two steps when using it for the first time: installation with the install.package() function, then loading it into the working session with the library()
  • Applied Spatial Statistics and Econometrics
    eBook - ePub
    • Katarzyna Kopczewska(Author)
    • 2020(Publication Date)
    • Routledge
      (Publisher)
    Chapter 1 Basic operations in the R software Mateusz Kopyt 1.1 About the R software 1 It is difficult to define what R is clearly. On the one hand, it is software for quantitative analyses in various fields. On the other hand, R is also a programming language that is oriented towards data analysis. What’s more, it is also a development (variant) of the S language developed in Bell Laboratories, which is also intended for quantitative analyses. The most appropriate description seems to be the statement that R is an environment (with its own programming language) which is focused on the processing of data and their (statistical) analysis, along with wide visualisation (graphic) possibilities. This program belongs to the so-called free and open software and is distributed and developed under the GNU GPL license. Therefore, the development of R is characterised by both all the advantages and drawbacks associated with such a licensing model and development method. R is available for all major platforms: Windows, MacOS and the UNIX family (i.e. Linux, FreeBSD and others). An important feature of the R environment is its flexibility and the possibility of constantly expanding applications. This is best seen by the number of additional packages available in the official repository. At the moment (June 2020), there are nearly 16,000 packages. For comparison, at the end of 2014, there were around 6000 official packages available. R also integrates well with other software languages such as C, C++ or Fortran. 2 Unlike many other programs distributed under a free license, R has very well ordered and rich documentation and a wide literature on its applications. Due to the fact that the first stable version of R appeared in 2000, it can be safely stated that the software is currently at a mature stage; more and more often it replaces other more specialised statistical packages in scientific research or commercial applications
  • Foundations of Statistics for Data Scientists
    A
    Using R in Statistical Science
    DOI: 10.1201/9781003159834-A

    A.0 Basics of R

    R is a free software for statistical computing and graphics that enjoys increasing popularity among data scientists. It is continuously enriched and updated by researchers who develop new statistical methods and supplement their published results with the associated R code. The website www.r-project.org has information about downloading and installing R . The Comprehensive R Archive Network (CRAN) at https:/​/​cran.r-project.org has a variety of add-on packages for data analysis and visualization. Many R users prefer to work in RStudio (https:/​/​rstudio.com/​products/​rstudio ), which includes a console, syntax-highlighting editor supporting direct code execution, as well as tools for plotting, history, debugging, and workspace management.
    This Appendix supplements the examples of R shown in this book, and the book's website has an R Appendix with more detail. Other helpful resources include the Introduction to R manual at https:/​/​cran.r-project.org/​doc/​manuals/​R-intro.pdf , the Swirl tutoring system at https:/​/​swirlstats.com , and books by Hothorn and Everitt (2014) , Wickham and Grolemund (2017) , and Baumer et al. (2017) .

    A.0.1 Starting a Session, Entering Commands, and Quitting

    Activation of R opens a console awaiting input at the prompt (>). To terminate an R session, type
    or select ‘Exit’ in the ‘File’ Menu. Values are assigned to variables by the operator ‘
    <
    ’ or ‘ =’. To see the value of an object x, type x at the command prompt or put the assignment in parentheses, such as (x <− mean(y)). You can provide multiple commands on a line by separating them with ‘;’ and enter comments following the # hashmark symbol. A command can expand to more than one line, in which case a + appears at the beginning of the additional line(s). R
  • Introductory Statistics
    eBook - ePub

    Introductory Statistics

    A Conceptual Approach Using R

    • William B. Ware, John M. Ferron, Barbara M. Miller(Authors)
    • 2013(Publication Date)
    • Routledge
      (Publisher)

    Appendix B

    An Introduction to R

    Virtually all courses in applied statistics, even those taught at the introductory level, employ one or more statistical packages for completing the analyses of data. Among the most popular are SAS, SPSS, Stata, and Systat. These packages are integrated statistical environments that allow the user to manage data, analyze data, and produce graphics. The latter three packages all employ a typical graphical user interface (GUI) with pull-down menus that allow the user to point-and-click to generate the results that they desire. On the other hand, the Windows version of SAS is much like the old mainframe version, with three primary windows. One window (Editor) allows the user to type in the commands, another window (Output) displays the results, and the third window (Log) displays the history of commands, provides information about the execution of the commands, and displays warnings and error messages.
    For many, many years, the first author has used SPSS in his classes so that students can avoid the tedious task of typing commands. However, over time, he became more and more convinced that this may not be in the best interests of students. There are several concerns. First, the location of the desired command within the pull-down menus is not always intuitive. Second, there are some particular tasks that are not available in the point-and-click interface. And third, he had a growing sense that students who construct sets of commands gain a better understanding of the material. Thus, we are making a change for this book; we are moving to support another program, R (R Development Core Team, 2011).

    WHAT IS R?

    R is a programming environment closely related to S, a program developed at Bell Labs in the mid-1970s. Currently, S is marketed commercially as S-PLUS by the Insightful Corporation. On the other hand, R is available for free downloading from the Comprehensive R Archive Network (CRAN) website (http://cran.r-project.org