Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
length, range, median, IQR
, hist
, quantile
, boxplot
, and stem
functions.
For this set of exercises you will use a dataset called islands
, an R dataset that contains the areas of the world’s major landmasses expressed in squared miles. To load the dataset run the following instruction: data(islands)
.
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.
Exercise 1
Load the islands
dataset and obtain the total number of observations.
Exercise 2
Measures of central tendency. Obtain the following statistics of islands
a)Mean
b)Median
Exercise 3
Using the function range
, obtain the following values:
a)Size of the biggest island
b)Size of the smallest island
Exercise 4
Measures of dispersion. Find the following values for islands:
a)Standard deviation
b)The range of the islands size using the function range
.
Exercise 5
Quantiles. Using the function quantile
obtain a vector including the following quantiles:
a) 0%, 25%, 50%, 75%, 100%
b) .05%, 95%
Exercise 6
Interquartile range. Find the interquartile range of islands.
Exercise 7
Create an histogram of islands with the following properties.
a) Showing the frequency of each group
b) Showing the proportion of each group
Exercise 8
Create box-plots with the following conditions
a) Including outiers
b) Without outliers
Exercise 9
Using the function boxplot
find the outliers of islands. Hint: use the argument prob=F
.
Exercise 10
Create a stem and leaf plot of islands
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.