Well, you could programmatically generate a large dataset, but nevertheless, I don't see the need to reinvent the wheel, instead of a for-loop you could simply use dplyr::left_join() or even base::merge(), see this example.
library(dplyr)
Y <- data.frame(
date = c("2005-01-01", "2005-01-01", "2005-01-01", "2005-01-02", "2005-01-02"),
region = c(0, 1, 2, 0, 1),
Value = c(12, 12, 11, 5, -8)
)
X <- data.frame(
date = c("2005-01-01", "2005-01-01", "2005-01-01", "2005-01-01", "2005-01-01", "2005-01-02", "2005-01-02"),
region = c(0, 0, 1, 2, 3, 0, 1)
)
X %>%
left_join(Y, by = c("date", "region"))
#> date region Value
#> 1 2005-01-01 0 12
#> 2 2005-01-01 0 12
#> 3 2005-01-01 1 12
#> 4 2005-01-01 2 11
#> 5 2005-01-01 3 NA
#> 6 2005-01-02 0 5
#> 7 2005-01-02 1 -8
Created on 2020-01-18 by the reprex package (v0.3.0.9000)