generated from SEFSC/SEFSC-Template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GDP and unemployment indicators to report
- Loading branch information
1 parent
84b52e3
commit df1df77
Showing
7 changed files
with
85 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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":[]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |