SlideShare une entreprise Scribd logo
1  sur  41
Télécharger pour lire hors ligne
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

Introduction to Data Analysis using R
Eslam Montaser Roushdi
Facultad de Inform´tica
a
Universidad Complutense de Madrid
Grupo G-Tec UCM
www.tecnologiaUCM.es

February, 2014
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

Our aim

Study and describe in depth analysis of Big Data by using the R program
and learn how to explore datasets to extract insight.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Outlines:

1

Getting Started - R Console.

2

Data types and Structures.

3

Exploring and Visualizing Data.

4

Programming Structures and Data Relationships.

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

1)Getting Started - R Console.

R program: is a free software environment for data analysis and graphics.
R program:
i) Programming language. ii) Data analysis tool.
R is used across many industries such as healthcare, retail, and financial
services.
R can be used to analyze both structured and unstructured datasets.
R can help you explore a new dataset and perform descriptive analysis.
Getting Started - R Console.

Data types and Structures.

1) Getting Started - R Console.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

2) Data types and Structures.
i) Data types.
numeric, logical, and character data types.

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

2) Data types and Structures.
ii) Data structures.
Vector.
List.
Multi-Dimensional ( Matrix/Array - Data frame).

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

2) Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

2) Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

2) Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

2) Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

2) Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

2) Data types and Structures.
Note that
Adding columns of data.
df1 <- cbind (df1, The new column).
Adding rows of data.
df1 <- rbind (df1, The new row).
Missing Data
Large datasets often have missing data.
Most R functions can handle.
> ages <- c (23, 45, NA)
> mean(ages)
[1] NA
> mean(ages, na.rm=TRUE)
[1] 34
Where, NA is a logical constant of length 1 which contains a missing
value indicator.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

3) Exploring and Visualizing Data.

Importing and Exporting data.
Filtering/Subsets.
Sorting.
Visulization/Analysis data.
How to import external data from files into R?
Reding Data from text files:
Multiple functions to read in data from text files.
Types of Data formats.
- Delimited.
- positional.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

3) Exploring and Visualizing Data.
Reading external data into R
Delimited files
R includes a family of functions for importing delimited text files into R, based
on the read.table function:
read.table(file, header, sep = , quote = , dec = , row.names, col.names,
as.is = , na.strings , colClasses , nrows =, skip = , check.names = ,
fill = , strip.white = , blank.lines.skip = , comment.char = ,
allowEscapes = , flush = , stringsAsFactors = , encoding = )
For example
name.last,name.first,team,position,salary
”Manning”,”Peyton”,”Colts”,”QB”,18700000
”Brady”,”Tom”,”Patriots”,”QB”,14626720
”Pepper”,”Julius”,”Panthers”,”DE”,14137500
”Palmer”,”Carson”,”Bengals”,”QB”,13980000
”Manning”,”Eli”,”Giants”,”QB”,12916666
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

3) Exploring and Visualizing Data.
Note that
The first row contains the column names.
Each text field is encapsulated in quotes.
Each field is separated by commas.
How to load this file into R
the first row contained column names (header=TRUE), that the delimiter
was a comma (sep=”,”), and that quotes were used to encapsulate text
(quote=”””).
The R statement that loads in this file:
> top.5.salaries <- read.table(”top.5.salaries.csv”,
+ header=TRUE,
+ sep=”,”,
+ quote=”””)
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

3) Exploring and Visualizing Data.

Fixed-width files
To read a fixed-width format text file into a data frame, you can use the
read.fwf function:
read.fwf(file, widths, header = , sep = , skip = , row.names, col.names,
n = , buffersize = ,. . .)

Note that
read.fwf can also take many arguments used by read.table, including as.is,
na.strings, colClasses, and strip.white.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

3) Exploring and Visualizing Data.
Let’s explore a public data using R.

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

3) Exploring and Visualizing Data.

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

3) Exploring and Visualizing Data.

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

3) Exploring and Visualizing Data.

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

3) Exploring and Visualizing Data.

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

3) Exploring and Visualizing Data.

Now let’s visualize trends in our data using Data Visualizations or graphics
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

3) Exploring and Visualizing Data.

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

3) Exploring and Visualizing Data.

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

3) Exploring and Visualizing Data.

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

4) Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

4) Programming Structures and Data Relationships.
Let’s examine decision making in R
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

4) Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

4) Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

4) Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

4) Programming Structures and Data Relationships.
Functions - Example
> f1 <- function(a,b) { return(a+b) }
> f2 <- function(a,b) { return(a-b) }
> f <- f1
> f(3,8)
[1] 11
> f <- f2
> f(5,4)
[1] 1
The apply family of functions
apply() can apply a function to elements of a matrix or an array.
lapply() applies a function to each column of a dataframe and returns a
list.
sapply() is similar but the output is simplified. It may be a vector or a
matrix depending on the function.
tapply() applies the function for each level of a factor.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

4) Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

4) Programming Structures and Data Relationships.

Common useful built-in functions
all()

#returns TRUE if all values are TRUE.

any()
args()
cat()

# returns TRUE if any values are TRUE.
# information on the arguments to a function.
# prints multiple objects, one after the other.

cumprod()

# cumulative product.

cumsum()

# cumulative sum.

mean()

# mean of the elements of a vector.

median() # median of the elements of a vector.
order()

# prints a single R object.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

4) Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

4) Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

4) Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

4) Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

4) Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Thanks!!

Programming Structures and Data Relationships.
Getting Started - R Console.

Data types and Structures.

Exploring and Visualizing Data.

Programming Structures and Data Relationships.

References

Grant Hutchison, Introduction to Data Analysis using R, October 2013.
John Maindonald, W. John Braun, Data Analysis and Graphics Using R:
An Example-Based Approach (Cambridge Series in Statistical and
Probabilistic Mathematics), Third Edition, Cambridge University Press
2003.
Nicholas J. Horton, Ken Kleinman, Using R for Data Management,
Statistical Analysis, and Graphics, CRC Press, 2010.

Contenu connexe

Tendances

Data visualization using R
Data visualization using RData visualization using R
Data visualization using RUmmiya Mohammedi
 
Introduction to R and R Studio
Introduction to R and R StudioIntroduction to R and R Studio
Introduction to R and R StudioRupak Roy
 
R programming slides
R  programming slidesR  programming slides
R programming slidesPankaj Saini
 
Introduction to R Programming
Introduction to R ProgrammingIntroduction to R Programming
Introduction to R Programmingizahn
 
Data manipulation on r
Data manipulation on rData manipulation on r
Data manipulation on rAbhik Seal
 
R data-import, data-export
R data-import, data-exportR data-import, data-export
R data-import, data-exportFAO
 
Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programmingVictor Ordu
 
Introduction to R Graphics with ggplot2
Introduction to R Graphics with ggplot2Introduction to R Graphics with ggplot2
Introduction to R Graphics with ggplot2izahn
 
How to get started with R programming
How to get started with R programmingHow to get started with R programming
How to get started with R programmingRamon Salazar
 
R programming presentation
R programming presentationR programming presentation
R programming presentationAkshat Sharma
 
Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programmingAlberto Labarga
 
Introduction to Rstudio
Introduction to RstudioIntroduction to Rstudio
Introduction to RstudioOlga Scrivner
 
Introduction to R
Introduction to RIntroduction to R
Introduction to RAjay Ohri
 

Tendances (20)

Data visualization using R
Data visualization using RData visualization using R
Data visualization using R
 
Introduction to R and R Studio
Introduction to R and R StudioIntroduction to R and R Studio
Introduction to R and R Studio
 
Data Management in R
Data Management in RData Management in R
Data Management in R
 
R studio
R studio R studio
R studio
 
R programming slides
R  programming slidesR  programming slides
R programming slides
 
Introduction to R Programming
Introduction to R ProgrammingIntroduction to R Programming
Introduction to R Programming
 
R programming
R programmingR programming
R programming
 
Data manipulation on r
Data manipulation on rData manipulation on r
Data manipulation on r
 
Class ppt intro to r
Class ppt intro to rClass ppt intro to r
Class ppt intro to r
 
R data-import, data-export
R data-import, data-exportR data-import, data-export
R data-import, data-export
 
Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programming
 
Introduction to R Graphics with ggplot2
Introduction to R Graphics with ggplot2Introduction to R Graphics with ggplot2
Introduction to R Graphics with ggplot2
 
R programming
R programmingR programming
R programming
 
Data analytics with R
Data analytics with RData analytics with R
Data analytics with R
 
How to get started with R programming
How to get started with R programmingHow to get started with R programming
How to get started with R programming
 
R programming presentation
R programming presentationR programming presentation
R programming presentation
 
R Programming
R ProgrammingR Programming
R Programming
 
Introduction to R programming
Introduction to R programmingIntroduction to R programming
Introduction to R programming
 
Introduction to Rstudio
Introduction to RstudioIntroduction to Rstudio
Introduction to Rstudio
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 

En vedette

Basic data analysis using R.
Basic data analysis using R.Basic data analysis using R.
Basic data analysis using R.C. Tobin Magle
 
Building ITIL Training &amp; Communication Plans
Building ITIL Training &amp; Communication PlansBuilding ITIL Training &amp; Communication Plans
Building ITIL Training &amp; Communication PlansITSM Academy, Inc.
 
Analysis of massive data using R (CAEPIA2015)
Analysis of massive data using R (CAEPIA2015)Analysis of massive data using R (CAEPIA2015)
Analysis of massive data using R (CAEPIA2015)AMIDST Toolbox
 
Scalable Data Analysis in R -- Lee Edlefsen
Scalable Data Analysis in R -- Lee EdlefsenScalable Data Analysis in R -- Lee Edlefsen
Scalable Data Analysis in R -- Lee EdlefsenRevolution Analytics
 
Using R for Analyzing Loans, Portfolios and Risk: From Academic Theory to Fi...
Using R for Analyzing Loans, Portfolios and Risk:  From Academic Theory to Fi...Using R for Analyzing Loans, Portfolios and Risk:  From Academic Theory to Fi...
Using R for Analyzing Loans, Portfolios and Risk: From Academic Theory to Fi...Revolution Analytics
 
5 Ways ITSM can Support DevOps, an ITSM Academy Webinar
5 Ways ITSM can Support DevOps, an ITSM Academy Webinar5 Ways ITSM can Support DevOps, an ITSM Academy Webinar
5 Ways ITSM can Support DevOps, an ITSM Academy WebinarITSM Academy, Inc.
 
Data and donuts: Data Visualization using R
Data and donuts: Data Visualization using RData and donuts: Data Visualization using R
Data and donuts: Data Visualization using RC. Tobin Magle
 
R Spatial Analysis using SP
R Spatial Analysis using SPR Spatial Analysis using SP
R Spatial Analysis using SPtjagger
 
Self-Organising Maps for Customer Segmentation using R - Shane Lynn - Dublin R
Self-Organising Maps for Customer Segmentation using R - Shane Lynn - Dublin RSelf-Organising Maps for Customer Segmentation using R - Shane Lynn - Dublin R
Self-Organising Maps for Customer Segmentation using R - Shane Lynn - Dublin Rshanelynn
 
Data analysis powerpoint
Data analysis powerpointData analysis powerpoint
Data analysis powerpointjamiebrandon
 
Iris data analysis example in R
Iris data analysis example in RIris data analysis example in R
Iris data analysis example in RDuyen Do
 
Text Mining with R -- an Analysis of Twitter Data
Text Mining with R -- an Analysis of Twitter DataText Mining with R -- an Analysis of Twitter Data
Text Mining with R -- an Analysis of Twitter DataYanchang Zhao
 

En vedette (15)

Facebook data analysis using r
Facebook data analysis using rFacebook data analysis using r
Facebook data analysis using r
 
Basic data analysis using R.
Basic data analysis using R.Basic data analysis using R.
Basic data analysis using R.
 
Building ITIL Training &amp; Communication Plans
Building ITIL Training &amp; Communication PlansBuilding ITIL Training &amp; Communication Plans
Building ITIL Training &amp; Communication Plans
 
Analysis of massive data using R (CAEPIA2015)
Analysis of massive data using R (CAEPIA2015)Analysis of massive data using R (CAEPIA2015)
Analysis of massive data using R (CAEPIA2015)
 
Scalable Data Analysis in R -- Lee Edlefsen
Scalable Data Analysis in R -- Lee EdlefsenScalable Data Analysis in R -- Lee Edlefsen
Scalable Data Analysis in R -- Lee Edlefsen
 
Using R for Analyzing Loans, Portfolios and Risk: From Academic Theory to Fi...
Using R for Analyzing Loans, Portfolios and Risk:  From Academic Theory to Fi...Using R for Analyzing Loans, Portfolios and Risk:  From Academic Theory to Fi...
Using R for Analyzing Loans, Portfolios and Risk: From Academic Theory to Fi...
 
5 Ways ITSM can Support DevOps, an ITSM Academy Webinar
5 Ways ITSM can Support DevOps, an ITSM Academy Webinar5 Ways ITSM can Support DevOps, an ITSM Academy Webinar
5 Ways ITSM can Support DevOps, an ITSM Academy Webinar
 
Data and donuts: Data Visualization using R
Data and donuts: Data Visualization using RData and donuts: Data Visualization using R
Data and donuts: Data Visualization using R
 
R Spatial Analysis using SP
R Spatial Analysis using SPR Spatial Analysis using SP
R Spatial Analysis using SP
 
Unit 3
Unit 3Unit 3
Unit 3
 
Self-Organising Maps for Customer Segmentation using R - Shane Lynn - Dublin R
Self-Organising Maps for Customer Segmentation using R - Shane Lynn - Dublin RSelf-Organising Maps for Customer Segmentation using R - Shane Lynn - Dublin R
Self-Organising Maps for Customer Segmentation using R - Shane Lynn - Dublin R
 
Data analysis powerpoint
Data analysis powerpointData analysis powerpoint
Data analysis powerpoint
 
R learning by examples
R learning by examplesR learning by examples
R learning by examples
 
Iris data analysis example in R
Iris data analysis example in RIris data analysis example in R
Iris data analysis example in R
 
Text Mining with R -- an Analysis of Twitter Data
Text Mining with R -- an Analysis of Twitter DataText Mining with R -- an Analysis of Twitter Data
Text Mining with R -- an Analysis of Twitter Data
 

Similaire à Introduction to data analysis using R

Data Analytics with R and SQL Server
Data Analytics with R and SQL ServerData Analytics with R and SQL Server
Data Analytics with R and SQL ServerStéphane Fréchette
 
Get started with R lang
Get started with R langGet started with R lang
Get started with R langsenthil0809
 
Data-Structure-original-QuantumSupply.pdf
Data-Structure-original-QuantumSupply.pdfData-Structure-original-QuantumSupply.pdf
Data-Structure-original-QuantumSupply.pdflehal93146
 
Unit 2 - Data Manipulation with R.pptx
Unit 2 - Data Manipulation with R.pptxUnit 2 - Data Manipulation with R.pptx
Unit 2 - Data Manipulation with R.pptxMalla Reddy University
 
Data Science as a Career and Intro to R
Data Science as a Career and Intro to RData Science as a Career and Intro to R
Data Science as a Career and Intro to RAnshik Bansal
 
Bridging data analysis and interactive visualization
Bridging data analysis and interactive visualizationBridging data analysis and interactive visualization
Bridging data analysis and interactive visualizationNacho Caballero
 
R programming & Machine Learning
R programming & Machine LearningR programming & Machine Learning
R programming & Machine LearningAmanBhalla14
 
IRJET- Data Retrieval using Master Resource Description Framework
IRJET- Data Retrieval using Master Resource Description FrameworkIRJET- Data Retrieval using Master Resource Description Framework
IRJET- Data Retrieval using Master Resource Description FrameworkIRJET Journal
 
Python data structures - best in class for data analysis
Python data structures -   best in class for data analysisPython data structures -   best in class for data analysis
Python data structures - best in class for data analysisRajesh M
 
EFFICIENT SCHEMA BASED KEYWORD SEARCH IN RELATIONAL DATABASES
EFFICIENT SCHEMA BASED KEYWORD SEARCH IN RELATIONAL DATABASESEFFICIENT SCHEMA BASED KEYWORD SEARCH IN RELATIONAL DATABASES
EFFICIENT SCHEMA BASED KEYWORD SEARCH IN RELATIONAL DATABASESIJCSEIT Journal
 
SE-IT DSA THEORY SYLLABUS
SE-IT DSA THEORY SYLLABUSSE-IT DSA THEORY SYLLABUS
SE-IT DSA THEORY SYLLABUSnikshaikh786
 
Data Structure and its Fundamentals
Data Structure and its FundamentalsData Structure and its Fundamentals
Data Structure and its FundamentalsHitesh Mohapatra
 
employee turnover prediction document.docx
employee turnover prediction document.docxemployee turnover prediction document.docx
employee turnover prediction document.docxrohithprabhas1
 

Similaire à Introduction to data analysis using R (20)

Data Analytics with R and SQL Server
Data Analytics with R and SQL ServerData Analytics with R and SQL Server
Data Analytics with R and SQL Server
 
Get started with R lang
Get started with R langGet started with R lang
Get started with R lang
 
Data-Structure-original-QuantumSupply.pdf
Data-Structure-original-QuantumSupply.pdfData-Structure-original-QuantumSupply.pdf
Data-Structure-original-QuantumSupply.pdf
 
Unit 2 - Data Manipulation with R.pptx
Unit 2 - Data Manipulation with R.pptxUnit 2 - Data Manipulation with R.pptx
Unit 2 - Data Manipulation with R.pptx
 
Data Science as a Career and Intro to R
Data Science as a Career and Intro to RData Science as a Career and Intro to R
Data Science as a Career and Intro to R
 
DISE - Database Concepts
DISE - Database ConceptsDISE - Database Concepts
DISE - Database Concepts
 
Bridging data analysis and interactive visualization
Bridging data analysis and interactive visualizationBridging data analysis and interactive visualization
Bridging data analysis and interactive visualization
 
4)12th_L-1_PYTHON-PANDAS-I.pptx
4)12th_L-1_PYTHON-PANDAS-I.pptx4)12th_L-1_PYTHON-PANDAS-I.pptx
4)12th_L-1_PYTHON-PANDAS-I.pptx
 
Algorithms and Data Structures~hmftj
Algorithms and Data Structures~hmftjAlgorithms and Data Structures~hmftj
Algorithms and Data Structures~hmftj
 
R programming & Machine Learning
R programming & Machine LearningR programming & Machine Learning
R programming & Machine Learning
 
IRJET- Data Retrieval using Master Resource Description Framework
IRJET- Data Retrieval using Master Resource Description FrameworkIRJET- Data Retrieval using Master Resource Description Framework
IRJET- Data Retrieval using Master Resource Description Framework
 
Python data structures - best in class for data analysis
Python data structures -   best in class for data analysisPython data structures -   best in class for data analysis
Python data structures - best in class for data analysis
 
EFFICIENT SCHEMA BASED KEYWORD SEARCH IN RELATIONAL DATABASES
EFFICIENT SCHEMA BASED KEYWORD SEARCH IN RELATIONAL DATABASESEFFICIENT SCHEMA BASED KEYWORD SEARCH IN RELATIONAL DATABASES
EFFICIENT SCHEMA BASED KEYWORD SEARCH IN RELATIONAL DATABASES
 
Data Structures for Robotic Learning
Data Structures for Robotic LearningData Structures for Robotic Learning
Data Structures for Robotic Learning
 
SE-IT DSA THEORY SYLLABUS
SE-IT DSA THEORY SYLLABUSSE-IT DSA THEORY SYLLABUS
SE-IT DSA THEORY SYLLABUS
 
Week 1
Week 1Week 1
Week 1
 
Data Structure and its Fundamentals
Data Structure and its FundamentalsData Structure and its Fundamentals
Data Structure and its Fundamentals
 
employee turnover prediction document.docx
employee turnover prediction document.docxemployee turnover prediction document.docx
employee turnover prediction document.docx
 
R basics
R basicsR basics
R basics
 
Rdbms
RdbmsRdbms
Rdbms
 

Plus de Victoria López

Alan turing uva-presentationdec-2019
Alan turing uva-presentationdec-2019Alan turing uva-presentationdec-2019
Alan turing uva-presentationdec-2019Victoria López
 
Seminar UvA 2018- socialbigdata
Seminar UvA  2018- socialbigdataSeminar UvA  2018- socialbigdata
Seminar UvA 2018- socialbigdataVictoria López
 
BIG DATA EN CIENCIAS DE LA SALUD Y CIENCIAS SOCIALES
BIG DATA EN CIENCIAS DE LA SALUD Y CIENCIAS SOCIALESBIG DATA EN CIENCIAS DE LA SALUD Y CIENCIAS SOCIALES
BIG DATA EN CIENCIAS DE LA SALUD Y CIENCIAS SOCIALESVictoria López
 
ICCES'2016 BIG DATA IN HEALTHCARE AND SOCIAL SCIENCES
ICCES'2016  BIG DATA IN HEALTHCARE AND SOCIAL SCIENCESICCES'2016  BIG DATA IN HEALTHCARE AND SOCIAL SCIENCES
ICCES'2016 BIG DATA IN HEALTHCARE AND SOCIAL SCIENCESVictoria López
 
Presentación Gupo G-TeC en Social Big Data
Presentación Gupo G-TeC en Social Big DataPresentación Gupo G-TeC en Social Big Data
Presentación Gupo G-TeC en Social Big DataVictoria López
 
Big data systems and analytics
Big data systems and analyticsBig data systems and analytics
Big data systems and analyticsVictoria López
 
Big Data. Complejidad,algoritmos y su procesamiento
Big Data. Complejidad,algoritmos y su procesamientoBig Data. Complejidad,algoritmos y su procesamiento
Big Data. Complejidad,algoritmos y su procesamientoVictoria López
 
APLICACIÓN DE TÉCNICAS DE OPTIMIZACIÓN Y BIG DATA AL PROBLEMA DE BÚSQUEDA...
APLICACIÓN DE TÉCNICAS DE OPTIMIZACIÓN Y BIG DATA AL PROBLEMA DE BÚSQUEDA...APLICACIÓN DE TÉCNICAS DE OPTIMIZACIÓN Y BIG DATA AL PROBLEMA DE BÚSQUEDA...
APLICACIÓN DE TÉCNICAS DE OPTIMIZACIÓN Y BIG DATA AL PROBLEMA DE BÚSQUEDA...Victoria López
 
G te c sesion1a-bioinformatica y big data
G te c sesion1a-bioinformatica y big dataG te c sesion1a-bioinformatica y big data
G te c sesion1a-bioinformatica y big dataVictoria López
 
G te c sesion1b-casos de uso
G te c sesion1b-casos de usoG te c sesion1b-casos de uso
G te c sesion1b-casos de usoVictoria López
 
G te c sesion2a-data collection
G te c sesion2a-data collectionG te c sesion2a-data collection
G te c sesion2a-data collectionVictoria López
 
G tec sesion2b-host-cloud y cloudcomputing
G tec sesion2b-host-cloud y cloudcomputingG tec sesion2b-host-cloud y cloudcomputing
G tec sesion2b-host-cloud y cloudcomputingVictoria López
 
G te c sesion3a-bases de datos modernas
G te c sesion3a-bases de datos modernasG te c sesion3a-bases de datos modernas
G te c sesion3a-bases de datos modernasVictoria López
 
G te c sesion3b- mapreduce
G te c sesion3b- mapreduceG te c sesion3b- mapreduce
G te c sesion3b- mapreduceVictoria López
 
G te c sesion4a-bigdatasystemsanalytics
G te c sesion4a-bigdatasystemsanalyticsG te c sesion4a-bigdatasystemsanalytics
G te c sesion4a-bigdatasystemsanalyticsVictoria López
 
G te c sesion4b-complejidad y tpa
G te c sesion4b-complejidad y tpaG te c sesion4b-complejidad y tpa
G te c sesion4b-complejidad y tpaVictoria López
 
Open Data para Smartcity-Facultad de Estudios Estadísticos
Open Data para Smartcity-Facultad de Estudios EstadísticosOpen Data para Smartcity-Facultad de Estudios Estadísticos
Open Data para Smartcity-Facultad de Estudios EstadísticosVictoria López
 
Deep Learning + R by Gabriel Valverde
Deep Learning + R by Gabriel ValverdeDeep Learning + R by Gabriel Valverde
Deep Learning + R by Gabriel ValverdeVictoria López
 
Fortune Time Institute: Big Data - Challenges for Smartcity
Fortune Time Institute: Big Data - Challenges for SmartcityFortune Time Institute: Big Data - Challenges for Smartcity
Fortune Time Institute: Big Data - Challenges for SmartcityVictoria López
 

Plus de Victoria López (20)

Alan turing uva-presentationdec-2019
Alan turing uva-presentationdec-2019Alan turing uva-presentationdec-2019
Alan turing uva-presentationdec-2019
 
Seminar UvA 2018- socialbigdata
Seminar UvA  2018- socialbigdataSeminar UvA  2018- socialbigdata
Seminar UvA 2018- socialbigdata
 
Jornada leiden short
Jornada leiden shortJornada leiden short
Jornada leiden short
 
BIG DATA EN CIENCIAS DE LA SALUD Y CIENCIAS SOCIALES
BIG DATA EN CIENCIAS DE LA SALUD Y CIENCIAS SOCIALESBIG DATA EN CIENCIAS DE LA SALUD Y CIENCIAS SOCIALES
BIG DATA EN CIENCIAS DE LA SALUD Y CIENCIAS SOCIALES
 
ICCES'2016 BIG DATA IN HEALTHCARE AND SOCIAL SCIENCES
ICCES'2016  BIG DATA IN HEALTHCARE AND SOCIAL SCIENCESICCES'2016  BIG DATA IN HEALTHCARE AND SOCIAL SCIENCES
ICCES'2016 BIG DATA IN HEALTHCARE AND SOCIAL SCIENCES
 
Presentación Gupo G-TeC en Social Big Data
Presentación Gupo G-TeC en Social Big DataPresentación Gupo G-TeC en Social Big Data
Presentación Gupo G-TeC en Social Big Data
 
Big data systems and analytics
Big data systems and analyticsBig data systems and analytics
Big data systems and analytics
 
Big Data. Complejidad,algoritmos y su procesamiento
Big Data. Complejidad,algoritmos y su procesamientoBig Data. Complejidad,algoritmos y su procesamiento
Big Data. Complejidad,algoritmos y su procesamiento
 
APLICACIÓN DE TÉCNICAS DE OPTIMIZACIÓN Y BIG DATA AL PROBLEMA DE BÚSQUEDA...
APLICACIÓN DE TÉCNICAS DE OPTIMIZACIÓN Y BIG DATA AL PROBLEMA DE BÚSQUEDA...APLICACIÓN DE TÉCNICAS DE OPTIMIZACIÓN Y BIG DATA AL PROBLEMA DE BÚSQUEDA...
APLICACIÓN DE TÉCNICAS DE OPTIMIZACIÓN Y BIG DATA AL PROBLEMA DE BÚSQUEDA...
 
G te c sesion1a-bioinformatica y big data
G te c sesion1a-bioinformatica y big dataG te c sesion1a-bioinformatica y big data
G te c sesion1a-bioinformatica y big data
 
G te c sesion1b-casos de uso
G te c sesion1b-casos de usoG te c sesion1b-casos de uso
G te c sesion1b-casos de uso
 
G te c sesion2a-data collection
G te c sesion2a-data collectionG te c sesion2a-data collection
G te c sesion2a-data collection
 
G tec sesion2b-host-cloud y cloudcomputing
G tec sesion2b-host-cloud y cloudcomputingG tec sesion2b-host-cloud y cloudcomputing
G tec sesion2b-host-cloud y cloudcomputing
 
G te c sesion3a-bases de datos modernas
G te c sesion3a-bases de datos modernasG te c sesion3a-bases de datos modernas
G te c sesion3a-bases de datos modernas
 
G te c sesion3b- mapreduce
G te c sesion3b- mapreduceG te c sesion3b- mapreduce
G te c sesion3b- mapreduce
 
G te c sesion4a-bigdatasystemsanalytics
G te c sesion4a-bigdatasystemsanalyticsG te c sesion4a-bigdatasystemsanalytics
G te c sesion4a-bigdatasystemsanalytics
 
G te c sesion4b-complejidad y tpa
G te c sesion4b-complejidad y tpaG te c sesion4b-complejidad y tpa
G te c sesion4b-complejidad y tpa
 
Open Data para Smartcity-Facultad de Estudios Estadísticos
Open Data para Smartcity-Facultad de Estudios EstadísticosOpen Data para Smartcity-Facultad de Estudios Estadísticos
Open Data para Smartcity-Facultad de Estudios Estadísticos
 
Deep Learning + R by Gabriel Valverde
Deep Learning + R by Gabriel ValverdeDeep Learning + R by Gabriel Valverde
Deep Learning + R by Gabriel Valverde
 
Fortune Time Institute: Big Data - Challenges for Smartcity
Fortune Time Institute: Big Data - Challenges for SmartcityFortune Time Institute: Big Data - Challenges for Smartcity
Fortune Time Institute: Big Data - Challenges for Smartcity
 

Dernier

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 

Dernier (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Introduction to data analysis using R

  • 1. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. Introduction to Data Analysis using R Eslam Montaser Roushdi Facultad de Inform´tica a Universidad Complutense de Madrid Grupo G-Tec UCM www.tecnologiaUCM.es February, 2014
  • 2. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. Our aim Study and describe in depth analysis of Big Data by using the R program and learn how to explore datasets to extract insight.
  • 3. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Outlines: 1 Getting Started - R Console. 2 Data types and Structures. 3 Exploring and Visualizing Data. 4 Programming Structures and Data Relationships. Programming Structures and Data Relationships.
  • 4. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 1)Getting Started - R Console. R program: is a free software environment for data analysis and graphics. R program: i) Programming language. ii) Data analysis tool. R is used across many industries such as healthcare, retail, and financial services. R can be used to analyze both structured and unstructured datasets. R can help you explore a new dataset and perform descriptive analysis.
  • 5. Getting Started - R Console. Data types and Structures. 1) Getting Started - R Console. Exploring and Visualizing Data. Programming Structures and Data Relationships.
  • 6. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. 2) Data types and Structures. i) Data types. numeric, logical, and character data types. Programming Structures and Data Relationships.
  • 7. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. 2) Data types and Structures. ii) Data structures. Vector. List. Multi-Dimensional ( Matrix/Array - Data frame). Programming Structures and Data Relationships.
  • 8. Getting Started - R Console. Data types and Structures. 2) Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships.
  • 9. Getting Started - R Console. Data types and Structures. 2) Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships.
  • 10. Getting Started - R Console. Data types and Structures. 2) Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships.
  • 11. Getting Started - R Console. Data types and Structures. 2) Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships.
  • 12. Getting Started - R Console. Data types and Structures. 2) Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships.
  • 13. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 2) Data types and Structures. Note that Adding columns of data. df1 <- cbind (df1, The new column). Adding rows of data. df1 <- rbind (df1, The new row). Missing Data Large datasets often have missing data. Most R functions can handle. > ages <- c (23, 45, NA) > mean(ages) [1] NA > mean(ages, na.rm=TRUE) [1] 34 Where, NA is a logical constant of length 1 which contains a missing value indicator.
  • 14. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 3) Exploring and Visualizing Data. Importing and Exporting data. Filtering/Subsets. Sorting. Visulization/Analysis data. How to import external data from files into R? Reding Data from text files: Multiple functions to read in data from text files. Types of Data formats. - Delimited. - positional.
  • 15. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 3) Exploring and Visualizing Data. Reading external data into R Delimited files R includes a family of functions for importing delimited text files into R, based on the read.table function: read.table(file, header, sep = , quote = , dec = , row.names, col.names, as.is = , na.strings , colClasses , nrows =, skip = , check.names = , fill = , strip.white = , blank.lines.skip = , comment.char = , allowEscapes = , flush = , stringsAsFactors = , encoding = ) For example name.last,name.first,team,position,salary ”Manning”,”Peyton”,”Colts”,”QB”,18700000 ”Brady”,”Tom”,”Patriots”,”QB”,14626720 ”Pepper”,”Julius”,”Panthers”,”DE”,14137500 ”Palmer”,”Carson”,”Bengals”,”QB”,13980000 ”Manning”,”Eli”,”Giants”,”QB”,12916666
  • 16. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 3) Exploring and Visualizing Data. Note that The first row contains the column names. Each text field is encapsulated in quotes. Each field is separated by commas. How to load this file into R the first row contained column names (header=TRUE), that the delimiter was a comma (sep=”,”), and that quotes were used to encapsulate text (quote=”””). The R statement that loads in this file: > top.5.salaries <- read.table(”top.5.salaries.csv”, + header=TRUE, + sep=”,”, + quote=”””)
  • 17. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 3) Exploring and Visualizing Data. Fixed-width files To read a fixed-width format text file into a data frame, you can use the read.fwf function: read.fwf(file, widths, header = , sep = , skip = , row.names, col.names, n = , buffersize = ,. . .) Note that read.fwf can also take many arguments used by read.table, including as.is, na.strings, colClasses, and strip.white.
  • 18. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. 3) Exploring and Visualizing Data. Let’s explore a public data using R. Programming Structures and Data Relationships.
  • 19. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. 3) Exploring and Visualizing Data. Programming Structures and Data Relationships.
  • 20. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. 3) Exploring and Visualizing Data. Programming Structures and Data Relationships.
  • 21. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. 3) Exploring and Visualizing Data. Programming Structures and Data Relationships.
  • 22. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. 3) Exploring and Visualizing Data. Programming Structures and Data Relationships.
  • 23. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 3) Exploring and Visualizing Data. Now let’s visualize trends in our data using Data Visualizations or graphics
  • 24. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. 3) Exploring and Visualizing Data. Programming Structures and Data Relationships.
  • 25. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. 3) Exploring and Visualizing Data. Programming Structures and Data Relationships.
  • 26. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. 3) Exploring and Visualizing Data. Programming Structures and Data Relationships.
  • 27. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 4) Programming Structures and Data Relationships.
  • 28. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 4) Programming Structures and Data Relationships. Let’s examine decision making in R
  • 29. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 4) Programming Structures and Data Relationships.
  • 30. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 4) Programming Structures and Data Relationships.
  • 31. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 4) Programming Structures and Data Relationships.
  • 32. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 4) Programming Structures and Data Relationships. Functions - Example > f1 <- function(a,b) { return(a+b) } > f2 <- function(a,b) { return(a-b) } > f <- f1 > f(3,8) [1] 11 > f <- f2 > f(5,4) [1] 1 The apply family of functions apply() can apply a function to elements of a matrix or an array. lapply() applies a function to each column of a dataframe and returns a list. sapply() is similar but the output is simplified. It may be a vector or a matrix depending on the function. tapply() applies the function for each level of a factor.
  • 33. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 4) Programming Structures and Data Relationships.
  • 34. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 4) Programming Structures and Data Relationships. Common useful built-in functions all() #returns TRUE if all values are TRUE. any() args() cat() # returns TRUE if any values are TRUE. # information on the arguments to a function. # prints multiple objects, one after the other. cumprod() # cumulative product. cumsum() # cumulative sum. mean() # mean of the elements of a vector. median() # median of the elements of a vector. order() # prints a single R object.
  • 35. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 4) Programming Structures and Data Relationships.
  • 36. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 4) Programming Structures and Data Relationships.
  • 37. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 4) Programming Structures and Data Relationships.
  • 38. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 4) Programming Structures and Data Relationships.
  • 39. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. 4) Programming Structures and Data Relationships.
  • 40. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Thanks!! Programming Structures and Data Relationships.
  • 41. Getting Started - R Console. Data types and Structures. Exploring and Visualizing Data. Programming Structures and Data Relationships. References Grant Hutchison, Introduction to Data Analysis using R, October 2013. John Maindonald, W. John Braun, Data Analysis and Graphics Using R: An Example-Based Approach (Cambridge Series in Statistical and Probabilistic Mathematics), Third Edition, Cambridge University Press 2003. Nicholas J. Horton, Ken Kleinman, Using R for Data Management, Statistical Analysis, and Graphics, CRC Press, 2010.