forked from bioinformatics-core-shared-training/basicr
-
Notifications
You must be signed in to change notification settings - Fork 40
/
solution-exercise4b.Rmd
41 lines (30 loc) · 1002 Bytes
/
solution-exercise4b.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
title: "Exercise 4b"
author: "Your Name"
date: '`r format(Sys.time(), "Last modified: %d %b %Y")`'
output: pdf_document
---
# Import the ozone dataset into R
```{r}
weather <- read.csv("ozone.csv")
```
# Scatter plot of solar radiation versus ozone level; points coloured in orange with filled circles
```{r}
plot(weather$Solar.R, weather$Ozone, col="orange", pch=16,
ylab="Ozone level", xlab="Solar Radiation",
main="Relationship between ozone level and
solar radiation")
```
# Histogram of Wind Speed; density on y axis, coloured purple, broken into bins of size 1 unit
```{r}
hist(weather$Wind, col="purple", xlab="Wind Speed",
main="Distribution of Wind Speed", breaks = 20,
freq=FALSE)
```
# Boxplot of Ozone level per-month; different colours for each month
```{r}
boxplot(weather$Ozone~weather$Month,col=rainbow(5),
names=c("May", "Jun", "Jul", "Aug","Sep"),
las=2,lab="Ozone Level",
main="Distribution of Ozone per-month")
```