Professional Documents
Culture Documents
Analytics
Introduction to R
INTRODUCTION TO R
R is a statistical programming language commonly used for statistical
analysis, data visualization, and other forms of data manipulation.
DICT Cordilleras
R STUDIO IDE
Environment
Source
Files/Plots/Packages
Control
DICT Cordilleras
Arithmetic
DICT Cordilleras
SPACES BETWEEN CHARACTERS
Spaces between characters do not affect the code. It’s a good practice to add a space between
characters to make it easier to read.
DICT Cordilleras
Order of Operations
DICT Cordilleras
Order of Operations
DICT Cordilleras
Using Multiple Parenthesis
DICT Cordilleras
Variables
In programming languages, we need to use various variables to store various
information. Variables are the reserved memory location to store values. As we
create a variable in our program, some space is reserved in memory.
DICT Cordilleras
Variables
In programming languages, we need to use various variables to store various
information. Variables are the reserved memory location to store values. As we
create a variable in our program, some space is reserved in memory.
DICT Cordilleras
Variables Naming Conventions
In programming languages, we need to use various variables to store various
information. Variables are the reserved memory location to store values. As we
create a variable in our program, some space is reserved in memory.
DICT Cordilleras
PROBLEM SOLVING PROCESS
Tools
OBJECTIVE
Prepare breakfast for the family
PROCEDURE
prepare the pan
add a little oil to the pan
Containers and get 1 egg
Ingredients
break and put the egg in the
pan
put salt
cook for 1 minute
remove the egg from the pan
repeat process 5 more times
DICT Cordilleras serve the breakfast
Data Types and Data Structures
Data Data
Types Structures
DICT Cordilleras
Data Types
DICT Cordilleras
DATA 1 Vectors
STRUCTURES 2 Lists
3 Matrices
4 Arrays
5 Data Frames
6 Factors
DICT Cordilleras
Data Structures
DICT Cordilleras
Vector
In R, a sequence of elements which share the same data type is known as vector
Creating Vectors
DICT Cordilleras
Vector
In R, a sequence of elements which share the same data type is known as vector
Creating Vectors
DICT Cordilleras
Vector
In R, a sequence of elements which share the same data type is known as vector
Creating Vectors
NOTE: c is variable
c() is the combine function
DICT Cordilleras
Vector
In R, a sequence of elements which share the same data type is known as vector
DICT Cordilleras
Data Frame
Comprised of rows and columns, where elements of each column is of the same type
DICT Cordilleras
Data Frame
Comprised of rows and columns, where elements of each column is of the same type
DICT Cordilleras
Data Frame
Comprised of rows and columns, where elements of each column is of the same type
DICT Cordilleras
Next : Data Exploration