Notes, Thoughts & Ideas

Thoughts, stories and ideas.

Store and reinstall R packages list

When moving the installation to the new R version or to the new environment, it's useful to setup all the packages you've been using for a long time.

# get the list of currently installed packages
package_df <- as.data.frame(installed.packages("~/R/win-library/3.5/"))
package_list <- as.character(package_df$Package)

# and finally install all packages from list
install.packages(package_list)