# how to fit a VAR with HAC standard errors in R

I am trying to fit a vector autoregression model using library(vars) but I was not able to get it to work with HAC standard errors.

> Canada %>% as_tibble() %>% head()
# A tibble: 6 x 4
e  prod    rw     U
<dbl> <dbl> <dbl> <dbl>
1  930.  405.  386.  7.53
2  930.  405.  388.  7.70
3  930.  404.  391.  7.47
4  931.  404.  394.  7.27
5  933.  405.  397.  7.37
6  934.  404.  400.  7.13


Now I can run my VAR easily.

library(vars)

> causality(myvar, 'e', vcov = vcovHAC)