Introduction to R PDF
Document Details
Tags
Summary
This document provides an introduction to the R programming language, emphasizing data analysis techniques and various data structures such as vectors, lists, matrices, and arrays. It details the types of variables available in R. This foundational knowledge is crucial for those initiating projects involving data analysis using R.
Full Transcript
UNIT -1 DATA PREPROCESSING Quick Revision of R R is a popular programming language used for statistical computing and graphical presentation. Its most common use is to analyze and visualize data. R is a programming language and software environment for statistical analysis AND...
UNIT -1 DATA PREPROCESSING Quick Revision of R R is a popular programming language used for statistical computing and graphical presentation. Its most common use is to analyze and visualize data. R is a programming language and software environment for statistical analysis AND graphics representation. R was created by Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand. Following are some of the features of R: R is a well-developed, simple and effective programming language which includes conditionals, loops, user defined recursive functions and input and output facilities. R has an effective data handling and storage facility. R provides a suite of operators for calculations on arrays, lists, vectors and matrices. R provides a large and integrated collection of tools for data analysis. R provides graphical facilities for data analysis and display either directly at the computer or printing at the papers. Variables Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. Data Types A data type, in programming, is a classification that specifies which type of value a variable has and what type of mathematical ,relational or logical operations can be applied to it without causing an error. In R, the variables are not declared as some data type. The variables are assigned with R-Objects and the data type of the R-object becomes the data type of the variable. There are many types of R-objects. The frequently used ones are − Vectors Lists Matrices Arrays Factors Data Frames Briefing of Data Types Vector Vector is a sequence of data elements of the same data type. There are 5 atomic vectors, also termed as 5 classes of vectors. Logical True or False Integer 15L, 30L, 1699L Numeric 5, 3.14, 9452 Complex 4+3i Character ‘A’, “Hey” Example: let's construct several vectors to store the diagnostic data of three medical patients. subject_name