Graphical tips in R
R-Tutorial: Quantitative Statistics
R-Project
Stat Methods
Exercise 1 - Boxplot
- Copy and paste the below data to a new "input.txt" file.
- Read in the data and print (to screen) it.
- Compute summary statistics for both variables, section and count.
- Make a boxplot of the count data.
- Add a title for the chart.
section,count
04,26
07,48
03,42
07,42
02,40
04,40
08,40
01,39
04,17
02,17
02,16
08,16
Exercise 2 - Histogram
- Copy and paste the below data to a new "input.txt" file.
- Read in the data and print it.
- Compute summary statistics for just the count column.
- Make a histogram plot of the count column.
- Add title and y-axis label.
- Add an abline at the mean.
section,count
04,26
07,48
03,42
07,42
02,40
04,40
08,40
01,39
04,17
02,17
02,16
08,16
04,26
07,48
03,42
07,42
02,40
04,40
08,40
01,39
04,17
02,17
02,16
08,16
Exercise 3 - Scatterplot
- Copy and paste the below data to a new "input.txt" file.
- Read in the data and print it.
- Compute summary statistics for just the waiting column.
- Make a two variable plot of eruptions vs waiting.
- Place an abline at the median value.
- Make a red title for the graph, using a font size of 4.
duration,waiting
3.600,79
1.800,54
3.333,74
2.283,62
4.533,85
2.883,55
Exercise 4 - Correlation Coefficient
- Copy and paste the below data to a new "input.txt" file.
- Read in the data and print it.
- Compute summary statistics for both variables.
- Make a plot of duration vs waiting.
- Conduct a linear-model, correlation coefficient between the two variables; duration and waiting.
- Add an abiline for the correlated linear model.
duration,waiting
3.600,79
1.800,54
3.333,74
2.283,62
4.533,85
2.883,55



