The goal of econres
is to facilitate my economics research by
helping me to load R
packages I commonly use, create descriptive
plots and table presentations of time series (based on my aesthetic
taste), and automate other tasks common for my economic research.
If someone else finds econres
useful for their research they are
free to use it (or parts of it) as they please.
You can install the development version of econres
from
GitHub with:
# install.packages("devtools")
devtools::install_github("lyuben-ivanov/econres")
This is a basic example which shows you how to efficiently produce an
elegant times series plot that demonstrates the “hockey stick” of
growth. To produce this plot you need to provide a suitably-formatted
data frame (in wide format, with the first column being the time index)
to the tsr()
function and it will plot the values in the columns as
time series and label them automatically with the names of the
corresponding columns. Do note that after the first element is supplied
to the function you can add any element that the methods of plot()
accept to customize the plot further.
library(econres)
mGDP |>
dplyr::select(c(Year, `United Kingdom`, `United States`, China, India, Germany)) |>
dplyr::filter(Year >= 1000) |>
dplyr::arrange(Year) |>
tsr(xlab = 'Year', main = "The hockey stick of growth", cex.main = 1.2)