For plotting a data, we need a set of data to work with. One of the built-in datasets is islands, which contains data about the surface area of the continents and some large islands on Earth. First, create a subset of the ten largest islands in this dataset. There are many ways of doing this, but the line of code chunk below sorts islands in decreasing order and then uses the head() function to retrieve only the first ten elements. Variable large.islands contains the ten largest islands in this dataset.
large.islands <- head(sort(islands, decreasing=TRUE), 10)
summary(large.islands)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 280 1372 4622 5832 8741 16988
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.