Renv : reproducing an environment automatically - guide

Environment is a package that allows you to reproduce an environment automatically. This guide will show you how to use the package.

Renv Vignette

1 How I did setup that

install.packages("renv")
renv::init()
renv::snapshot()

2 How you need to set it up

install.packages("renv")
renv::init()
  • Then you need to copy the renv.lock file and use it to replace the one that was created in project directory. Then do:
renv::restore()
LS0tDQp0aXRsZTogImByIHBhcmFtcyR0aXRsZWAiDQpkYXRlOiAiYHIgZm9ybWF0KFN5cy50aW1lKCksICclZCAlQiwgJVknKWAiDQphdXRob3I6IEV2ZSBaZXlsIEZpc2tlYmVjayBhbmQgTWFkZWxhaW5lIE5vcnN0csO2bQ0KcGFyYW1zOg0KICANCiAgdGl0bGU6ICJSZW52IDogcmVwcm9kdWNpbmcgYW4gZW52aXJvbm1lbnQgYXV0b21hdGljYWxseSAtIGd1aWRlIiANCiAgcHJvamVjdF9wYXRoOiAiYHIgaGVyZTo6aGVyZSgpYCINCmtuaXQ6IChmdW5jdGlvbihpbnB1dEZpbGUsIGVuY29kaW5nKSB7DQogIA0KICBybWFya2Rvd246OnJlbmRlcihpbnB1dEZpbGUsIGVuY29kaW5nID0gZW5jb2RpbmcsIG91dHB1dF9kaXIgPSAiLi4vLi4vZG9jcyIpIH0pICANCm91dHB1dDogDQogIA0KICBybWRmb3JtYXRzOjpyZWFkdGhlZG93bjoNCiAgICAgIA0KICAgICAgDQogICAgICBjc3M6IC4uL3N0eWxlLmNzcw0KICAgICAgc2VsZl9jb250YWluZWQ6IHRydWUNCiAgICAgIGNvZGVfZG93bmxvYWQ6IHRydWUNCiAgICAgIHRvY19kZXB0aDogNA0KICAgICAgZGZfcHJpbnQ6IHBhZ2VkDQogICAgICBjb2RlX2ZvbGRpbmc6IHNob3cNCiAgICAgIGF1dGhvcjogcGFyYW1zJGF1dGhvcg0KICAgICAgaGlnaGxpZ2h0OiBlc3ByZXNzbw0KICAgICAgbnVtYmVyX3NlY3Rpb25zOiB0cnVlDQplZGl0b3Jfb3B0aW9uczogDQogIG1hcmtkb3duO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