'How can I install the haven package when using renv?

I am running into an error when trying to install the haven package in an R project that is set up to use renv.

When I try to run renv::install("haven") or install.packages("haven") I get the following error message: Error: install of package 'haven' failed [error code 1].

Installing the package outside of a project and without a renv environment works.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source