Giter VIP home page Giter VIP logo

website's People

Contributors

henrikbengtsson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

website's Issues

source("http://callr.org/install#DESCRIPTION")

Add support for

source('http://callr.org/install#DESCRIPTION')

which should install all packages listed in the DESCRIPTION file of the current directory. This is useful for installing all required packages after having checked out/cloned a source package, e.g.

$ git clone git@github.com:Bioconductor/BiocParallel.git
$ Rscript -e "source('http://callr.org/install#DESCRIPTION')"

install: Error in install.packages(update[instlib == l, "Package"], l, contriburl = contriburl, ...

source('http://callr.org/install#<pkg>') gives the below error on Windows (only) in at least R 3.0.3, 3.1.2, but not in 3.1.2 Patched (2015-02-22 r67879) and not in R (>= 3.1.3).

Reproducible example

> getRversion()
[1] '3.0.3'

## Make sure aroma.affymetrix 2.13.0 is installed
> install.packages("aroma.affymetrix", repos="http://cran.r-project.org")

## Try to update to aroma.affymetrix 2.13.1
> source('http://callr.org/install#aroma.affymetrix')
Installing/updating package: 'aroma.affymetrix'
NOTE: Detected option pkgType='win.binary'. Changed to 'both' during this instal
lation process in order to make sure the most up-to-date versions of packages ar
e installed in case they are only available as source.
aroma.affymetrix :
 Version 2.13.0 installed in C:/Users/hb/R/win-library/3.0
 Version 2.13.1 available at http://braju.com/R
Update (y/N/c)?  y
Error in install.packages(update[instlib == l, "Package"], l, contriburl = contriburl,  :
  type == "both" cannot be used if 'available' or 'contriburl' is specified
In addition: Warning message:
In installer(pkgs) :
  NOTE: Detected option pkgType='win.binary'. Changed to 'both' during this inst
allation process in order to make sure the most up-to-date versions of packages
are installed in case they are only available as source.

Originally reported by Nipun Mistry @ MD Anderson for Windows R 3.1.1.

CLEANUP: Less messages for non-interactive sessions

Installing in a non-interactive session gives lots of unnecessary output, e.g.

cclc01{henrik}: Rscript -e "source('http://callr.org/install#PSCBS,cghFLasso')"
Installing/updating packages: 'PSCBS', 'cghFLasso'
cairoDevice :
 Version 2.21 installed in /cbc/henrik/R/x86_64-unknown-linux-gnu-library/3.1
 Version 2.22 available at http://cran.r-project.org
Update (y/N/c)?
mgcv :
 Version 1.8-5 installed in /cbc/henrik/R/x86_64-unknown-linux-gnu-library/3.1
 Version 1.8-6 available at http://cran.r-project.org
Update (y/N/c)?
lattice :
 Version 0.20-30 installed in /home/shared/cbc/software_cbc/R/R-3.1.3-20150309/lib64/R/library
 Version 0.20-31 available at http://cran.r-project.org
Update (y/N/c)?

Package updates:
          Previous Current
cghFLasso    0.2-1   0.2-1
PSCBS       0.44.0  0.44.0

Packages installed/updated. Load them by:

 library('PSCBS')
 library('cghFLasso')

TASK: Drop some of these outputs when interactive() is FALSE.

'install' outputs to standard output; should be standard error

The 'install' script outputs also to std. out. This renders it "useless" in report generators, since such output will clutter up the report. Should be redirected to std. err., e.g.

$ Rscript -e "source('http://callr.org/install#R.devices')" > log.out 2> log.err
$ ls -l log.*
-rwx------+ 1 4294967295 mkpasswd  201 Jan 28 11:28 log.err
-rwx------+ 1 4294967295 mkpasswd 6667 Jan 28 11:28 log.out
$ head log.out
abind :
 Version 1.4-0 installed in C:/Users/hb/R/win-library/3.2
 Version 1.4-1 available at http://R-Forge.R-project.org
Update (y/N/c)?
base64 :
 Version 1.1 installed in C:/Users/hb/R/win-library/3.2
 Version 1.2 available at http://R-Forge.R-project.org
Update (y/N/c)?
bbmle :
 Version 1.0.17 installed in C:/Users/hb/R/win-library/3.2
Installing/updating package: 'R.devices'

install: Smarter trimming of package specs

install is quite forgiving in how packages are specified, but it does not handle when the list contains a version number, which may be included from cut'n'pasting from a DESCRIPTION field, e.g.

> source("http://callr.org/install#RUnit, BiocGenerics, IlluminaDataTestFiles (>= 1.0.2), BiocStyle")
Installing/updating packages:RUnit’, ‘BiocGenerics’, ‘IlluminaDataTestFiles (>= 1.0.2)’, ‘BiocStyleInstalling packages from package repositories:

install: Installing from URL gives false "Failed to install requested package: 'R.cache_0.10.0.tar.gz'"

Example:

> source("http://callr.org/install#http://cran.r-project.org/src/contrib/R.cache_0.10.0.tar.gz")
Installing/updating package: 'R.cache_0.10.0.tar.gz'
Installing packages from URLs:
Downloading package from url: http://cran.r-project.org/src/contrib/R.cache_0.10.0.tar.gz
Installing R.cache
"C:/PROGRA~1/R/R-3.2.0patched/bin/x64/R" --vanilla CMD INSTALL  \
  "C:/Users/hb/AppData/Local/Temp/RtmpS6uwe3/devtools1c784a6567a9/R.cache"  \
  --library="C:/Users/hb/R/win-library/3.2" --install-tests

* installing *source* package 'R.cache' ...
** package 'R.cache' successfully unpacked and MD5 sums checked
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (R.cache)

Package updates:
                      Previous Current
R.cache                   <NA>  0.10.0
R.cache_0.10.0.tar.gz     <NA>    <NA>

Failed to install requested package: 'R.cache_0.10.0.tar.gz'

The package does indeed install, e.g.

> library(R.cache)
R.cache v0.10.0 (2014-06-10) successfully loaded. See ?R.cache for help.

The problem is in the internal findPackages() that fails to parse the package name properly.

install: Installing from URL with "flags" causes GitHub user error

install: Installing from URL with "flags" causes GitHub user error, e.g.

# This works
> source("http://callr.org/install#http://cran.r-project.org/src/contrib/R.methodsS3_1.7.0.tar.gz")

# But using any type of "flag" gives an error:
> source("http://callr.org/install#http://cran.r-project.org/src/contrib/R.methodsS3_1.7.0.tar.gz[U]")
Installing/updating package: 'R.methodsS3'
Installing packages from GitHub:
Error in username %||% getOption("github.user") %||% stop("Unknown username.")

  Unknown username.
>

First reported by @pneuvial.

'install' does not pickup/install "SuggestsNote" packages *recursively*

'install' does not pickup/install "SuggestsNote" packages recursively, e.g.

source("http://callr.org/install#aroma.affymetrix")

installs all dependent packages as well as the "recommended" ones listed in aroma.affymetrix DESCRIPTION field 'SuggestsNote'. However, it does scan ditto of dependent + recommended packages, which means that none of the "recommended" packages of aroma.core are installed.

install: Installing via a GitHub branch that has a forward slash in its name gives invalid summary information

When installing a branch from GitHub that contains a forward slash (/) in the branch name, e.g. feature/binMeans-weights, the callr.org/install script reports (incorrectly) that the installation failed at the end. The summary table is also incorrect. Note that it is only the information that is wrong here. The actual installation does indeed succeed.

Example:

> source("http://callr.org/install#HenrikBengtsson/matrixStats@feature/binMeans-weights")
Installing/updating package: 'binMeans-weights'
Installing packages from GitHub:
Downloading github repo HenrikBengtsson/matrixStats@feature/binMeans-weights
Installing matrixStats
'/Library/Frameworks/R.framework/Resources/bin/R' --vanilla CMD INSTALL  \
  '/private/tmp/RtmpvF8IYs/devtoolsd80a1d0c0a23/HenrikBengtsson-matrixStats-9e8c27b'  \
  --library='/Users/hb/Library/R/3.2/library' --install-tests

* installing *source* package 'matrixStats' ...
[...]
Package updates:
                 Previous Current
binMeans-weights     <NA>    <NA>

Failed to install requested package: 'binMeans-weights'
> matrixStats::binMeans

install: GitHub branches with forward slashes installs correctly but give wrong output

Installing GitHub branches with forward slashes installs correctly but give wrong output. For example:

> source("http://callr.org/install#HenrikBengtsson/R.matlab@hotfix/tempfiles")
Installing/updating package: 'tempfiles'
Installing packages from GitHub:
Downloading GitHub repo HenrikBengtsson/R.matlab@hotfix/tempfiles
Installing R.matlab
"C:/PROGRA~1/R/R-3.2.2patched/bin/x64/R" --no-site-file --no-environ  \
  --no-save --no-restore CMD INSTALL  \
  "C:/Users/hb/AppData/Local/Temp/RtmpCaxEym/devtools21085d2d1711/HenrikBengtsson-R.matlab-5d9e9dc"  \
  --library="C:/Users/hb/R/win-library/3.2" --install-tests

* installing *source* package 'R.matlab' ...
** R
** inst
** tests
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (R.matlab)

Package updates:
            Previous Current
R.matlab  3.2.0-9000 3.2.0-1
tempfiles       <NA>    <NA>

Failed to install requested package: 'tempfiles'

Note how install get confused about what the actual package name is.

BUG: the condition has length > 1

> source("http://callr.org/install#aroma.affymetrix")
Installing/updating package: 'aroma.affymetrix'
Error in if (is.na(deps)) return(character(0L)) : 
  the condition has length > 1

install: Add protection for user mistakes

Add protection for user mistakes when trying to install.

## Forgotten GitHub user/organism (should give an error)
source('http://callr.org/install#aroma.affymetrix@develop')

install: Tries to install single package twice if failure

When one tries to install multiple packages at once, it sometimes fails because of this fact. In that case the install script falls back and tries to install them one by one. This feature seems to also kick in even when there is only a single package requested, e.g.

> source("http://callr.org/install#EBImage")
Installing/updating package: 'EBImage'
Installing packages from package repositories:
Installing package into 'C:/Users/hb/R/win-library/3.3'
[...]
The downloaded source packages are in
        'C:\Users\hb\AppData\Local\Temp\RtmpUjxvmu\downloaded_packages'
At least one of the packages failed to install. Will fall back to install each of them one by one: 'EBImage'
Installing package into 'C:/Users/hb/R/win-library/3.3'
(as 'lib' is unspecified)

install: false warning when repos name differ from package name

When the GitHub repository name differ from the package name, then install incorrectly summaries the results saying the package failed to install, e.g.

> source("http://callr.org/install#satijalab/seurat")
[...]
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (Seurat)

Package updates:
             Previous Current
cowplot          <NA>   0.7.0
FNN              <NA>     1.1
RcppProgress     <NA>     0.3
ROCR             <NA>   1.0-7
seurat           <NA>    <NA>
Seurat           <NA>   1.4.0
tclust           <NA>   1.2-3
tsne             <NA>   0.1-3

Failed to install requested package: 'seurat'

but the package did install as the table shows and:

library("Seurat")
Loading required package: ggplot2
Loading required package: cowplot

Attaching package: 'cowplot'

The following object is masked from 'package:ggplot2':

    ggsave

Create yet-another-R package for this?

People have once in a while asked me why this is not an R package. Sure, it can certainly be and I've even though of adding a callr (callr.org) package to CRAN, such that the install script here could be just:

if (!requireNamespace("callr.org"))
    install.packages("callr.org", repos = "https://cloud.r-project.org")
callr.org::install()

Question is, do CRAN need yet another installer R package, or should the features be added / contributed to one of the existing once, e.g. remotes?

Error: Line starting '<!DOCTYPE HTML PUBLI ...' is malformed!

On some platforms we're now getting:

> source("http://callr.org/install#HenrikBengtsson/recycle")
Installing/updating package: 'recycle'
Installing packages from GitHub:
Installing package into '/cbc/henrik/R/x86_64-pc-linux-gnu-library/3.2'
(as 'lib' is unspecified)
Error: Line starting '<!DOCTYPE HTML PUBLI ...' is malformed!
>

This might be due to the new HTTP -> HTTPS upgrade in R - not sure.

> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server release 6.6 (Santiago)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_3.2.2

install: Add support for sets, e.g. HenrikBengtsson/{listenv,globals}

The following two should be equivalent

source('http://callr.org/install#listenv,globals')
source('http://callr.org/install#{listenv,globals}')

as well as these two

source('http://callr.org/install#HenrikBengtsson/listenv,HenrikBengtsson/globals')
source('http://callr.org/install#HenrikBengtsson/{listenv,globals}')

Fallback to use a default `repos`, iff option is unset

Add default repos option, iff unset.

> source("http://callr.org/install#BiocStyle")
Installing/updating package:BiocStyleInstalling packages from package repositories:
Installing package into/home/hb/R/i686-pc-linux-gnu-library/3.2’
(aslibis unspecified)
--- Please select a CRAN mirror for use in this session ---
PuTTY X11 proxy: unable to connect to forwarded X server: Network error: Connection refused
HTTPS CRAN mirror

 1: 0-Cloud [https]                2: Austria [https]
 3: Belgium (Ghent) [https]        4: Chile [https]
 5: China (Beijing 4) [https]      6: Colombia (Cali) [https]
 7: France (Lyon 1) [https]        8: France (Lyon 2) [https]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.