All computer programs track time numerically relative to an epoch. What is the numeric value of the assignment due date 02/23/2023?
as.numeric(as.Date("2023-02-23"))
2. Use the tidyquant package to access the FRED API and download 3 time series datasets.
meat_tq <- tq_get(c("PBEEFUSDM","PPORKUSDM","PPOULTUSDM"),get="economic.data",from="1990-01-01",to="2023-01-01")
3. Use case_when() to change the name of the series to something more descriptive.
meat_final <- meat_tq %>%
mutate(description=case_when(symbol=="PBEEFUSDM"~"Global Beef Price",symbol=="PPORKUSDM"~"Global Pork Price",symbol=="PPOULTUSDM"~"Global Poultry Price"))
4. Export the data in .csv format for Tableau
write_csv(meat_final,"meat_prices.csv")
In Tableau, connect to all 3 of the time series datasets you downloaded in part 1. Create a relationship between the three datasets by setting the Date variables equal to one another.
Create a new field called months_around_financial_crisis that calculates the number of months between the indicated month and the month the 2008 financial crisis was first reflected in U.S. stock markets (August 2007).
Create a visualization that shows monthly prices for your three commodities, using your new months_around_financial_crisis variable as the time dimension (x-axis).
Create a structural break in your time series at the time of the financial crisis. Add trend lines for each series leading up to and following the financial crisis.
In the caption of your figure, explain whether or not these three commodities appeared to be influence by the financial crisis. Does any difference across commodities make sense?
Finally, format your visualization by limiting the time window (to something that helps the audience see differences before and after the crisis), adding color, a useful title, appropriate marker labels, text annotations, etc.
7. Choose one of your commodities to focus on. Create a new visualization that shows annual trends in maximum, minimum, and average prices for this commodity before and after the financial crisit. Does this annual analysis change your results or conclusions about the impacts of the financial crisis for this commoditiy? Discuss any differences, similarities, or additional insights from this analysis in the figure caption.
Visit my Tableau Public page here: https://public.tableau.com/app/profile/brandon.dodd