11

I ran the command update.packages(checkBuilt = TRUE, ask = FALSE).

However my html directories were not writable and I got a lot of:

Warning in file.create(f.tg) :
cannot create file '/usr/share/doc/R-3.0.1/html/packages.html', reason 'Permission denied'

Is there a way to force reinstall all packages now that I've fixed my permissions issues, so I get those HTML files? The code part got installed correctly, so update.packages doesn't work anymore.

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
ILoveCoding
  • 866
  • 1
  • 9
  • 18

4 Answers4

7

install.packages installs a package even if it exists in your library. And of course it will be in the latest version.

alko989
  • 7,688
  • 5
  • 39
  • 62
5

You could run this script:

lib_loc <- "[library location]"
to_install <- unname(installed.packages(lib.loc = lib_loc)[, "Package"])
install.packages(pkgs = to_install)

If you are using the default library:

to_install <- unname(installed.packages()[, "Package"])
install.packages(pkgs = to_install)
xm1
  • 1,663
  • 1
  • 17
  • 28
1

I could not install a requirement because of lack of libgit2-devel, I installed it and reran the install.packages('devtools') but it just completed right away. You could just remove.packages('name') and then install again.

Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
DGM
  • 76
  • 5
0

Force reinstall (recompile) all! packages:

allPackages <- installed.packages()[,"Package"]
exclude = c("base", "compiler", "datasets", "graphics", "grDevices", "grid", "methods", "parallel", "splines", "stats", "stats4", "tcltk", "tools", "utils")
packages = allPackages[!allPackages %in% exclude]
install.packages(pkgs = packages, clean = TRUE, quiet = FALSE)
DmitriBolt
  • 355
  • 5
  • 5