Skip to content

Commit

Permalink
Add GDP and unemployment indicators to report
Browse files Browse the repository at this point in the history
  • Loading branch information
CarissaGervasi-NOAA committed Mar 13, 2024
1 parent 84b52e3 commit df1df77
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .quarto/cites/index.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Report_book_files\\Discussion_material.qmd":[],"OA.qmd":[],"Report_book_files\\Intro_text.qmd":[],"index.qmd":[],"Report_book_files\\FMP_objectives.qmd":[],"Report_book_files\\Performance_indicators.qmd":[],"Report_book_files\\Risk_indicators.qmd":[],"Report_book_files\\Report4.qmd":[],"Lab-report\\OA.qmd":[]}
{"Report_book_files\\Discussion_material.qmd":[],"Report_book_files\\Risk_indicators.qmd":[],"Report_book_files\\Report4.qmd":[],"index.qmd":[],"Lab-report\\OA.qmd":[],"Report_book_files\\Intro_text.qmd":[],"Report_book_files\\Performance_indicators.qmd":[],"Report_book_files\\FMP_objectives.qmd":[],"OA.qmd":[]}
11 changes: 11 additions & 0 deletions Report_book_files/Performance_indicators.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,21 @@ plotIndicatorTimeSeries(inddata, coltoplot = 1:8, plotrownum = 2, trendAnalysis

Indicator 24

```{r}
load("../indicator_objects/GDP.RData")
plotIndicatorTimeSeries(inddata, coltoplot = 1:2, trendAnalysis = T, sublabel = T)
```

### Unemployment

Indicator 25

```{r}
load("../indicator_objects/unemployment.RData")
plotIndicatorTimeSeries(inddata, coltoplot = 1:2, trendAnalysis = T, sublabel = T, dateformat = "%Y%b")
```


## 5.3 Equity

### Gini coefficient for distribution of landings and revenue
Expand Down
2 changes: 1 addition & 1 deletion index.qmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# 1. Executive Summary

Here is where we will paste the executive summary
Here is where we will paste the executive summary
Binary file added indicator_objects/GDP.RData
Binary file not shown.
Binary file added indicator_objects/unemployment.RData
Binary file not shown.
33 changes: 33 additions & 0 deletions indicator_processing/non_automated/GDP.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

### Whole GDP data for PR and USVI from Amy Freitag (manually downloaded from FRED https://fred.stlouisfed.org/)
### latest data run through 2021 for USVI and 2022 for PR.

# USVI data: https://fred.stlouisfed.org/series/MKTGDPVIA646NWDB
# PR data: https://fred.stlouisfed.org/series/NYGDPMKTPCDPRI


rm(list = ls())

# load data -------------------------------------

d <- read.csv("indicator_data/GDP.csv")
head(d)

# remove first row with units, convert dollars to billion dollars
d = d[-1,]
PR = (as.numeric(d$Puerto.Rico))/1000000000
USVI = (as.numeric(d$USVI, na.action = na.omit))/1000000000

# save as indicator object ----------------------
datdata <- (min(d$indicator):max(d$indicator))
inddata <- data.frame(PR, USVI)
labs <- c("GDP" , "Billion dollars", "Puerto Rico",
"GDP" , "Billion dollars", "USVI")
indnames <- data.frame(matrix(labs, nrow = 3, byrow = F))
inddata <- list(labels = indnames, indicators = inddata, datelist = datdata)
class(inddata) <- "indicatordata"

# plot and save ----------------------------------
save(inddata, file = "indicator_objects/GDP.RData")

plotIndicatorTimeSeries(inddata, coltoplot = 1:2, sublabel = TRUE)
39 changes: 39 additions & 0 deletions indicator_processing/non_automated/Unemployment.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

### Unemployment data for PR and USVI from Amy Freitag (manually downloaded from FRED https://fred.stlouisfed.org/)
### latest data run through 12/2023.

# USVI data: DON'T KNOW WHERE THIS CAME FROM, ASK AMY
# PR data: https://fred.stlouisfed.org/series/PRUR


rm(list = ls())

# load data -------------------------------------

d <- read.csv("indicator_data/unemployment.csv")
head(d)

# remove first row with units
d = d[-1,]

# Convert date column to Date object
d$indicator <- as.Date(d$indicator, format = "%m/%d/%Y")
# Format date column to %Y%b
d$indicator <- format(d$indicator, "%Y%b")

PR = (as.numeric(d$PR.unemployment, na.action = na.omit))
USVI = (as.numeric(d$USVI.unemployment, na.action = na.omit))

# save as indicator object ----------------------
datdata <- d$indicator
inddata <- data.frame(PR, USVI)
labs <- c("Unemployment" , "Percent", "Puerto Rico",
"Unemployment" , "Percent", "USVI")
indnames <- data.frame(matrix(labs, nrow = 3, byrow = F))
inddata <- list(labels = indnames, indicators = inddata, datelist = datdata)
class(inddata) <- "indicatordata"

# plot and save ----------------------------------
save(inddata, file = "indicator_objects/unemployment.RData")

plotIndicatorTimeSeries(inddata, coltoplot = 1:2, sublabel = TRUE, dateformat = "%Y%b")

0 comments on commit df1df77

Please sign in to comment.