Posts

Showing posts with the label addition

1.3.12 Working with Data - Video 6 Data Analysis - Plots and Summary Tables

In addition to scatter plots, we can create several other types of plots in R. Two examples are histograms and box plots. Let's first create a histogram of CellularSubscribers. To do this, we'll use the hist function. So in your R console type hist, and then in parentheses WHO$CellularSubscribers. Close the parentheses and hit Enter. If you go over to your plotting window you can see that the values of CellularSubscribers are shown on the x-axis and the frequency of these values is shown on the y-axis. A histogram is useful for understanding the distribution of a variable. Here we can see that the most frequent value of CellularSubscribers is around 100. We can also easily create a box plot in R. We'll make a box plot of LifeExpectancy sorted by Region. So back in your R console type boxplot, and then in parentheses, WHO$LifeExpectancy and then a tilde symbol followed by WHO$Region. Close the parentheses and hit Enter. Then go over to your plotting window. You...