Installing package into '/home/runner/work/_temp/Library'
(as 'lib' is unspecified)
library(treemap)
fedfunds<-read_csv("_data/FedFundsRate.csv")
Rows: 904 Columns: 10
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
dbl (10): Year, Month, Day, Federal Funds Target Rate, Federal Funds Upper T...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
head(fedfunds)
The FedFundsRate data set contains information about federal fund rates from 1954-2017 provided by the Federal Open Markets Committee (FOMC). This data set contains 904 observations and 10 variables, which includes different rates (unemployment, inflation, federal funds target rate), targets (upper, target, and lower), and real GDP.
For my graph depicting time, I decided to use a a geom_line to show Unemployment Rates over the years. After I initially run the visualization, I noticed there are some values missing from Unemployment Rate. I then decided to use the fill() function to to replace missing values for better visualization.
##Geom_line to show Unemployment Rate over te years
fedfunds_date%>%fill(`Unemployment Rate`)%>%ggplot(aes(date,`Unemployment Rate`))+geom_line()+theme_classic()+labs(title ="Unemployment Rates Over Time", x ="Years", Y ="Unemployment Rate")
For my second graph, I chose a treemap to represent the median values for unemployment rate. I was particularly interested in the rates from 2007 to 2017.
fedfunds%>%filter(Year ==2007:2017)%>%group_by(Year)%>%summarize(Median_Unemployment=median(`Unemployment Rate`))%>%treemap(index ="Year", vSize ="Median_Unemployment", type ="index", title="Unemployment Median Rate Comparison from 2007 to 2017")
Warning: There was 1 warning in `filter()`.
ℹ In argument: `Year == 2007:2017`.
Caused by warning in `Year == 2007:2017`:
! longer object length is not a multiple of shorter object length