Descriptive Analytics – Part 0 : data exploration

October 19, 2016
By

(This article was first published on R-exercises, and kindly contributed to R-bloggers)

download

Descriptive Analytics is the examination of data or content, usually manually performed, to answer the question “What happened?”.

This is the first set of exercise of a series of exercises that aims to provide a descriptive analytics solution to the ‘2008’ data set from here. Download it and save it as a csv file. This data set which contains the arrival and departure information for all domestic flights in the US from 2008 has become the “iris” data set for Big Data. In the exercises below we cover the basics of data exploration. I chose it to be the ‘part 0’ of the descriptive analytics solution, because in order to proceed to the data pre-processing and then description you need to get to know your data set while it is not formally on the value chain of descriptive analytics process. Before proceeding, it might be helpful to look over the help pages for the str, summary, dim, nrow, ncol, names, is.na, match functions.

Answers to the exercises are available here.

If you obtained a different (correct) answer than those listed on the solutions page, please feel free to post your answer as a comment on that page.

Load the data before proceeding. Let’s name the dataset as ‘flights’
flights <- read.csv('2008.csv')

Exercise 1
Print the structure of the data. What do you think about it?

Exercise 2
Print the summary statistics of the data. What do you think about the values? (format, consistency, completeness)

Exercise 3
Print the dimensionality of the data (number of rows and columns)

Exercise 4
Print the number of rows. This may seem like a silly command, but it is quite useful for loops and if statements.

Exercise 5
Print the number of columns.

Exercise 6
Print the names of the variables.

Exercise 7
Print whether the first column has missing values (NAs). Try to answer this question with two ways. Hint: %in%

Exercise 8
Print the number of variables that contain missing values.

Exercise 9
Find the portion of the variables that contain missing values. What do you think about it?

Exercise 10
Print the names of the variables that contain missing values.

To leave a comment for the author, please follow the link and comment on their blog: R-exercises.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)