---
title: "Assignment 8"
author: "Monica Campos - Team Maitreyi"
output:
flexdashboard::flex_dashboard:
theme: yeti
orientation: columns
social: menu
source_code: embed
---
```{r setup, include=FALSE}
library(plotly)
library(flexdashboard)
library(dplyr)
library(ggplot2)
library(tidyr)
```
### Arms Trends
```{r}
trade <- read.csv('WITS Partner Timeseries Countries.csv')
weapons <- read.csv('SIPRI Big Three Arms Transfer 1992-2022.csv')
merged <- read.csv('Merged_df.csv')
#SIPRI Time Series Data
set.seed(123456)
sampled_weapons <- weapons %>%
sample_n(100)
top_weaponstrade <- weapons %>%
top_n(50, TIV.delivery.values)
weaponsplot <- ggplot(sampled_weapons, aes(x = Delivery.year, y = Recipient, color = Supplier)) +
geom_line(size = 1) +
geom_point() +
labs(
title = "Arms Transfer Trends Over Time",
x = "Year",
y = "Recipient",
color = "Supplier"
) +
theme_minimal()
weaponsplot
```
### Time series Trade Data
```{r}
set.seed(123)
sampled_trade <- trade %>%
sample_n(90) # Sample 500 observations for a clearer plot
tradeplot <- ggplot(trade, aes(x = Year, y = Total_Trade, color = Country)) +
geom_line(size = 1) +
geom_point() +
labs(
title = "Trade Trends Over Time",
x = "Year",
y = "Total Trade",
color = "Country"
) +
theme_minimal()
tradeplot
```