Skip to content

Instantly share code, notes, and snippets.

@marcelotournier
Last active March 29, 2022 01:02
Show Gist options
  • Save marcelotournier/29d700940a2291693d6ca77bd282ff8c to your computer and use it in GitHub Desktop.
Save marcelotournier/29d700940a2291693d6ca77bd282ff8c to your computer and use it in GitHub Desktop.
# Save your R package list:
packages <- levels(as.data.frame(installed.packages()[,1])[,1])
write.csv(packages, "requirements.txt", row.names = FALSE, quote = FALSE)
# Load your R package list:
backup <- levels(read.csv("requirements.txt")[,1])
# Install your package list on a new machine:
install.packages(backup)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment