R PROGRAMMING
Basic Data Science (R Programming) Gourav Mondal Senior Lecturer
3 REGENESYS’ Integrated Leadership and Management model  Holistic focus on the individual (SQ, EQ, IQ, and PQ)  Interrelationships are dynamic between individual, team, institution and the external environment (systemic)  Strategy affects individual, team, organisational, and environmental performance  Delivery requires alignment of of strategy, structure, systems and culture
Lists • One-Dimensional • Heterogeneous data structure • Indexing Starts from ‘1’. • List can be a  list of vectors,  a list of matrices,  a list of characters,a factor.  a list of functions, etc. A List may contain another list as its item
LIST OPERATIONS OUTPUT
CONVERTING LIST TO VECTOR AND MATRIX
Arrays • fixed number of dimensions • allocation of space at contiguous memory locations • Unidimensional arrays are called vectors • Two-dimensional arrays are called matrices • Arrays are N-Dimensional data sets. Syntax – Define an R Array • variable <- array(list, dimension) • where list contains the elements of array and dimension is a list containing the information about dimensionality of the array. • If dimension is c(2,5,4,8), the array is 4-Dimensional with dimensions 2x5x4x8.
R Factors The command used to create or modify a factor in R language is – is a vector along with the distinct values of vector as levels. Factors are useful during statistical modelling. factor() Factor The two steps to creating a factor are: • Creating a vector • Converting the vector created into a factor using function factor() • implemented to represent categorical data • Stores data on multiple levels • the different values that the factor can take are called levels • can be stored as integers with a corresponding label to every unique integer
• In R language when we create a data frame, its column is categorical data and hence a factor is automatically created on it. We can create a data frame and check if its column is a factor.
Data Frames • used to store the tabular data • Data Frames are data displayed in a format as a table. Data Frame is a set of equal length vectors. The vectors could be of different data types • Data Frames can have different types of data inside it. • While the first column can be character , the second and third can be numeric or logical . However, each column should have the same type of data..

basics of R programming introduction basic

  • 1.
  • 2.
    Basic Data Science (RProgramming) Gourav Mondal Senior Lecturer
  • 3.
    3 REGENESYS’ Integrated Leadershipand Management model  Holistic focus on the individual (SQ, EQ, IQ, and PQ)  Interrelationships are dynamic between individual, team, institution and the external environment (systemic)  Strategy affects individual, team, organisational, and environmental performance  Delivery requires alignment of of strategy, structure, systems and culture
  • 4.
    Lists • One-Dimensional • Heterogeneousdata structure • Indexing Starts from ‘1’. • List can be a  list of vectors,  a list of matrices,  a list of characters,a factor.  a list of functions, etc. A List may contain another list as its item
  • 5.
  • 6.
    CONVERTING LIST TOVECTOR AND MATRIX
  • 7.
    Arrays • fixed numberof dimensions • allocation of space at contiguous memory locations • Unidimensional arrays are called vectors • Two-dimensional arrays are called matrices • Arrays are N-Dimensional data sets. Syntax – Define an R Array • variable <- array(list, dimension) • where list contains the elements of array and dimension is a list containing the information about dimensionality of the array. • If dimension is c(2,5,4,8), the array is 4-Dimensional with dimensions 2x5x4x8.
  • 8.
    R Factors The commandused to create or modify a factor in R language is – is a vector along with the distinct values of vector as levels. Factors are useful during statistical modelling. factor() Factor The two steps to creating a factor are: • Creating a vector • Converting the vector created into a factor using function factor() • implemented to represent categorical data • Stores data on multiple levels • the different values that the factor can take are called levels • can be stored as integers with a corresponding label to every unique integer
  • 9.
    • In Rlanguage when we create a data frame, its column is categorical data and hence a factor is automatically created on it. We can create a data frame and check if its column is a factor.
  • 10.
    Data Frames • usedto store the tabular data • Data Frames are data displayed in a format as a table. Data Frame is a set of equal length vectors. The vectors could be of different data types • Data Frames can have different types of data inside it. • While the first column can be character , the second and third can be numeric or logical . However, each column should have the same type of data..