I have a dataset which I am trying to plot using ggplot
and geofacet
. Below is a sample of my data :
# A tibble: 6 x 3
date actuals_vol geo
<date> <dbl> <chr>
1 2014-02-02 9607815. AK
2 2014-02-09 9552680. AK
3 2014-02-16 9251645. AK
4 2014-02-23 9177905 AK
5 2014-03-02 9254805 AK
6 2014-03-09 9222940. AK
This is the code I am using to plot the data in tile maps:
ggplot(cig_prophet_states, aes(date, actuals_vol)) +
geom_area(fill='#114365') +
facet_geo(~ geo, grid = "us_state_grid2", label="name") +
scale_x_continuous(labels = function(x) paste0("'", substr(x, 3, 4))) +
labs(title = "GDP by State 1997-2016 ($, trillions)",
caption = "Data Source: St. Louis FRED",
x = "Year",
y = "volume") +
theme(strip.text.x = element_text(size = 8))
And I get this following error: Error in as.Date.numeric(value) : 'origin' must be supplied