R Presentation
R Presentation
All the actions of R are done on objects stored in the active memory of the computer:
no temporary files are used. The readings and writings of files are used for input and
output of data and results (graphics, . . . ). The user executes the functions via some
commands. The results are displayed directly on the screen, stored in an object, or
written on the disk. Since the results are themselves objects, they can be considered
as data and analyzed as such. Data files can be read from the local disk or from a
remote server through internet.
1) All the functions which are available to users are stored in a
localised in a directory. This is the location where R is
installed such as (C:\Program Files\R\R-3.6.1\library).
4)All the packages have a directory named R with the file name
similar to package.
5) For Example: for base package, the name of the file will be
(C:\Program Files\R\R-3.6.1\library\base\R).
• RELATABLE TO OTHER
FEATURES 2.
PROGRAMMING LANGUAGE
OF “R”
3. • SUPPORTS EXTENSION
R is cross-platform compatible
One of the biggest point of interest in R is that we can use it on few working
frameworks and fluctuated hardware or software. We can use R language on any
operating system, be it Windows, Linux, or Macintosh. This compatibility makes R
more popular than its counterparts.
myfunction<-function(arg1,arg2, ..){
statements
return(object)
}
Variables
Data Types
Operations
Terminologies
used in R Loops
String
Functions
Functions
A function, in a programming environment, is a set of instructions. A
programmer builds a function to avoid repeating the same task, or
reduce complexity.
A function should be written to carry out a specified a tasks
may or may not include arguments
contain a body
length() function
In many cases, we want to know the length of
a vector for computation or to be used in a
for loop. The length() function counts the
number of rows in vector x
2. Math Function
3.Statistical Functions
STRING
Any value coded within a pair of single quote (' ') and double quotes (" ") in R
programming is termed as a 'string'. On the inside, R stores all the strings within
double quotes, even if you use single quotes to create them.
LOOPS
Loops are used to execute multiple statements by using one or more
conditions. It saves the time as the user doesn’t need to input the same
conditions multiple times.
VARIABLES
A variable provides us with named storage that our programs can manipulate.
A variable in R can store an atomic vector, group of atomic vectors or a
combination of many R objects. A valid variable name consists of letters,
numbers and the dot or underline characters. The variable name starts with a
letter or the dot not followed by a number.
OPERATIONS
R Programming works with numerous
data types, including:
Scalars
Vectors (numerical, character, logical) Data Types
Matrices
Data frames
Lists