Permalink
Browse files

fix unlinking pkgs in installPackages when pkgs=""

  • Loading branch information...
1 parent d685b95 commit d3d48671c0a388f76cc877c605ea5d293753f720 Gerhard Schöfl committed Apr 26, 2012
Showing with 25 additions and 7 deletions.
  1. +9 −5 R/utilities.r
  2. +15 −2 dev.r
  3. +1 −0 rmisc.Rproj
View
14 R/utilities.r
@@ -162,11 +162,15 @@ installPackages <- function(pkgs="",
pkg_dir <- path.expand(getOption("packages"))
if (isTRUE(tags)) {
- ## if the package is present in the packages directory delete
- ## it and do a fresh install
- rm_files <- dir(pkg_dir, full.names=TRUE)
- rm_files <- rm_files[grepl(paste(pkgs, collapse="|"), rm_files)]
- unlink(rm_files, recursive=TRUE)
+
+ if (all(nzchar(pkgs))) {
+ ## if the package is present in the packages directory delete
+ ## it and do a fresh install
+ rm_files <- dir(pkg_dir, full.names=TRUE)
+ rm_files <- rm_files[grepl(paste(pkgs, collapse="|"), rm_files)]
+ unlink(rm_files, recursive=TRUE)
+ }
+
## install from CRAN or Bioconductor
if (repos == "bioc") {
biocLite(pkgs=pkgs, destdir=pkg_dir, ...)
View
17 dev.r
@@ -3,7 +3,20 @@ build(pkg="~/R/Devel/rmisc")
install(pkg="~/R/Devel/rmisc")
load_all("/home/gerhard/R/Devel/rmisc/")
-installPackages("httr", "github", "hadley")
-installPackages("evaluate")
+installPackages(c("rmisc","rentrez"), "github", "gschofl")
+installPackages(c("devtools","scales","sinartra","evaluate","ggplot2"),
+ "github", "hadley")
+installPackages(c("plyr","test_that","staticdocs","httr","stringr"),
+ "github", "hadley")
+installPackages(c("reshape","lubridate","helpr"),
+ "github", "hadley")
+installPackages(c("roxygen"), "github", "klutometis")
+installPackages(c("knitr"), "github", "yihui")
+installPackages(c("igraph","multtest","vegan","foreach","iterators"),
+ repos="CRAN", dependencies=TRUE)
+installPackages(c("XML","RCurl","RMySQL","itertools","lme4","ape"),
+ repos="CRAN", dependencies=TRUE)
+
+installPackages(c("Biostrings","genomes","biomaRt"), dependencies=TRUE)
View
1 rmisc.Rproj
@@ -11,3 +11,4 @@ Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
+RootDocument:

0 comments on commit d3d4867

Please sign in to comment.