Posts

Exploring and describing fuel efficiency data

Image
Exploring and describing fuel efficiency data Now that  we have imported the automobile  fuel efficiency dataset into R and learned a little about the nuances of importing, the next step is to do some preliminary analysis of the dataset. The purpose of this analysis is to explore what the data looks like and get your feet wet with some of R's most basic commands. Getting ready If you completed the previous recipe, you should have everything you need to continue. How to do it... The following steps will lead you through the initial exploration of our dataset, where we compute some basic parameters about the dataset: First, let's find out how many observations (rows) are in our data: Copy nrow(vehicles) ## 34287 Next, let's find out how many variables (columns) are in our data: Copy ncol(vehicles) ## 74 Now, let's get a sense of which columns of data are present in the data frame using the  name function: Copy ...

Importing automobile fuel efficiency data into R

Importing automobile fuel efficiency data into R For  the following recipes, you will need the R statistical  programming language installed on your computer (either the base R or RStudio, but the authors strongly recommend using the excellent and free RStudio) and the automobile fuel efficiency dataset. This quick recipe will help you ensure that you have everything you will need to complete this analysis project. Getting ready You will need an Internet connection to complete this recipe, and we assume that you have installed RStudio for your particular platform, based on the instructions in the previous chapter. How to do it... If you  are using RStudio, the following three steps will  get you ready to roll: Launch RStudio on your computer. At the R console prompt, install the two R packages needed for this project: Copy install.packages("plyr") install.packages("ggplot2") install.packages("reshape2") Loa...