New to R. Brain size of pea.
Suppose I have two separate data frames.
df1 = tibble(
date = as.Date(c("1990-10-01", "1991-11-01", "1992-11-01")),
wage = c(4, 5, 6)
)
df2 = tibble(
date = as.Date(c("1990-01-01", "1991-01-01", "1992-01-01")),
cpi = c(2, 3, 4)
)
I wish to add a column from the second data frame to the first. Also, I wish to match just the year of the date.
I'm thinking left_join factors in some how, but I am unsure as to exactly how.