---
title: "Assignment"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: scroll
theme: flatly
social: menu
source_code: embed
navbar:
- { title: "Dataset Description", href: "#dataset-description" }
- { title: "Univariate Analysis", href: "#univariate-analysis" }
- { title: "Bivariate Analysis", href: "#bivariate-analysis" }
- { title: "Multivariate Analysis", href: "#multivariate-analysis" }
---
```{r setup, include=FALSE}
library(flexdashboard)
library(dplyr)
library(DT)
library(ggplot2)
Temperature <- read.csv("Temperture.csv")
```
## Dataset Description {.tabset .active}
### Head dataset
```{r}
head(Temperature)
```
### About
```{r}
str(Temperature)
```
### Summary
```{r}
summary(Temperature)
```
###Convert
```{r}
Temperature$ANNUAL <- as.numeric(as.character(Temperature$ANNUAL))
Temperature$JAN.FEB <- as.numeric(as.character(Temperature$JAN.FEB))
Temperature$MAR.MAY <- as.numeric(as.character(Temperature$MAR.MAY))
Temperature$JUN.SEP <- as.numeric(as.character(Temperature$JUN.SEP))
Temperature$OCT.DEC <- as.numeric(as.character(Temperature$OCT.DEC))
```
### Numeric
```{r}
any(is.na(Temperature$ANNUAL))
any(is.na(Temperature$JAN.FEB))
any(is.na(Temperature$MAR.MAY))
any(is.na(Temperature$JUN.SEP))
any(is.na(Temperature$OCT.DEC))
```
### Annual Histogram
```{r}
hist(Temperature$ANNUAL,
main="Histogram of Annual Temperatures",
xlab="Annual Temperature (°C)",
col="blue",
breaks=20,
border="black")
```
### Jan-FEB
```{r}
Temperature$JAN.FEB <- as.numeric(as.character(Temperature$JAN.FEB))
any(is.na(Temperature$JAN.FEB))
hist(Temperature$JAN.FEB,
main="Histogram of Jan-Feb Temperatures",
xlab="Temperature (°C)",
col="lightblue",
breaks=20,
border="black")
```
### MAR-MAY
```{r}
hist(Temperature$MAR.MAY,
main="Histogram of Mar-May Temperatures",
xlab="Temperature (°C)",
col="lightgreen",
breaks=20,
border="black")
```
### JUN-SEP
```{r}
hist(Temperature$JUN.SEP,
main="Histogram of Jun-Sep Temperatures",
xlab="Temperature (°C)",
col="lightcoral",
breaks=20,
border="black")
```
### OCT-DEC
```{r}
hist(Temperature$OCT.DEC,
main="Histogram of Oct-Dec Temperatures",
xlab="Temperature (°C)",
col="lightgoldenrod",
breaks=20,
border="black")
```
### BOXPLOT for ANNUAL TEMP
```{r}
ggplot(Temperature, aes(x=ANNUAL)) +
geom_histogram(binwidth=1, fill="blue", color="black", alpha=0.7) +
labs(title="Histogram of Annual Temperatures", x="Annual Temperature (°C)", y="Frequency") +
theme_minimal()
```
### BOXPLOT JAN-FEB
```{r}
ggplot(Temperature, aes(x=JAN.FEB)) +
geom_histogram(binwidth=1, fill="lightblue", color="black", alpha=0.7) +
labs(title="Histogram of Jan-Feb Temperatures", x="Temperature (°C)", y="Frequency") +
theme_minimal()
```
### BOXPLOT MAR.MAY
```{r}
ggplot(Temperature, aes(x=MAR.MAY)) +
geom_histogram(binwidth=1, fill="lightgreen", color="black", alpha=0.7) +
labs(title="Histogram of Mar-May Temperatures", x="Temperature (°C)", y="Frequency") +
theme_minimal()
```
### BOXPLOT JUN-SEP
```{r}
ggplot(Temperature, aes(x=JUN.SEP)) +
geom_histogram(binwidth=1, fill="lightcoral", color="black", alpha=0.7) +
labs(title="Histogram of Jun-Sep Temperatures", x="Temperature (°C)", y="Frequency") +
theme_minimal()
```
### BOXPLOT OCT-DEC
```{r}
ggplot(Temperature, aes(x=OCT.DEC)) +
geom_histogram(binwidth=1, fill="lightgoldenrod", color="black", alpha=0.7) +
labs(title="Histogram of Oct-Dec Temperatures", x="Temperature (°C)", y="Frequency") +
theme_minimal()
```
###Scatterplot JAN-FEB
```{r}
ggplot(Temperature, aes(x=JAN.FEB, y=ANNUAL)) +
geom_point(color="blue", alpha=0.6) +
labs(title="Scatter Plot: ANNUAL vs JAN-FEB Temperatures", x="Jan-Feb Temperature (°C)", y="Annual Temperature (°C)") +
theme_minimal()
```
###Scatterplot MAR-MAY
```{r}
ggplot(Temperature, aes(x=MAR.MAY, y=ANNUAL)) +
geom_point(color="green", alpha=0.6) +
labs(title="Scatter Plot: ANNUAL vs MAR-MAY Temperatures", x="Mar-May Temperature (°C)", y="Annual Temperature (°C)") +
theme_minimal()
```
### Scatterplot JUN-SEP
```{r}
ggplot(Temperature, aes(x=JUN.SEP, y=ANNUAL)) +
geom_point(color="red", alpha=0.6) +
labs(title="Scatter Plot: ANNUAL vs JUN-SEP Temperatures", x="Jun-Sep Temperature (°C)", y="Annual Temperature (°C)") +
theme_minimal()
```