Chapter 1: The Programming Language Basics (PDF)
Document Details
Uploaded by Deleted User
2021
Ahmed Boulemden
Tags
Summary
This document provides an introductory overview of the R programming language. It explains fundamental concepts like mathematical operations and the use of R for statistical analysis. The document also showcases several practical examples.
Full Transcript
Chapter 1 : The programming language basics Ahmed Boulemden 2020-2021 1- Introduction In the context of programming, R refers to: A high level programming language widely used for statistics and data analysis fields. An IDE to develop with this language. R...
Chapter 1 : The programming language basics Ahmed Boulemden 2020-2021 1- Introduction In the context of programming, R refers to: A high level programming language widely used for statistics and data analysis fields. An IDE to develop with this language. R is available as open source software under the GNU GPL. It supports different OS platforms: Unix-like, Windows, … R was derived from S language, a previous programming language developed by Bell labs during the 60s and 70s. It was named after the two creators of the language: Ross Ihaka and Robert gentleman. They started the language development at the beginning of the 90s at the Okland University. R was an open source substitution to the S language after the latter commercialization. The R core team supervises the development of the language which is currently a joint effort by a wide community of contributors (researchers and developers from different fields: computer science, maths, etc). the community publishes regularly a wide range of libraries on the official archive named The Comprehensive R Archive Network. It is accessible through: (https://cran.r-project.org/index.html) R is an interpreted language. R is case sensitive. The main core was written in C, Fortran and R languages. There are many IDEs supporting the R language. We use the r-studio IDE. r-studio is available on: (https://www.rstudio.com/) 2- Mathematical operations R supports the common arithmetic operations and mathematical functionality. Addition, substraction, multiplication and division can be performed with the symbols +, -, *, / respectively. The symbol ^ is used for the exponents. The order of calculations in a single command is controlled by parentheses (). Standard mathematical rules (PEMDAS) are applied and follow the left-to-right order of operations. 10^2+3*60/8-3 ## 119.5 Square root: sqrt(3) ## 1.732051 sqrt(x = 3) ## 1.732051 Exercice: write R commands for - Logarithm and exponential: log(x = 243, base = 3) ## 5 exp(x = 3) ## 20.08554 - Assignment: