简体   繁体   中英

R cran Impossible to install dependencies recursively from install_github from devtools

I try to test my package developed on Ubuntu 16.04 with Windows 7. For both platforms I work on R 3.3.1 (but I also test on 3.3.0).

My package is saved on my GitHub repo ( https://github.com/charlottesirot/elementR ). When I run this command from Ubuntu, no problem happens:

    library(devtools)
    install_github("charlottesirot/elementR", dependencies = T , force = T)

but with windows 7, I have the following answer:

Downloading GitHub repo charlottesirot/elementR@master from URL https://api.github.com/repos/charlottesirot/elementR/zipball/master Installing elementR "C:/PROGRA~1/R/R-33~1.1/bin/i386/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD \\ INSTALL \\ "C:/Users/Cha/AppData/Local/Temp/RtmpUX1GVA/devtoolsa907a336b/charlottesirot-elementR-103e064" \\ --library="C:/Users/Cha/Documents/R/win-library/3.3" --install-tests

  • installing source package 'elementR' ... ** R ** inst ** preparing package for lazy loading Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package called 'XML' ERROR: lazy loading failed for package 'elementR'
  • removing 'C:/Users/Cha/Documents/R/win-library/3.3/elementR' Error: Command failed (1)

As I understand, R tries to install the dependencies of my package (eg Shiny...) but it does not manage to install the dependencies of the dependencies (eg XML from gnumeric package)

Thus I try to manually install XML thinking that perhaps there was a problem with XML and then:

  • installing source package 'elementR' ... ** R ** inst ** preparing package for lazy loading Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : there is no package called 'gtools' ERROR: lazy loading failed for package 'elementR'
  • removing 'C:/Users/Cha/Documents/R/win-library/3.3/elementR'

I cannot install all the packages manually, it does not make sense !!!

Moreover when I try something less cryptic than my package, thinking that I could makea mistake in my code:

install_github("hadley/ggplot2", force = T)
  • installing source package 'ggplot2' ... ** R ** data *** moving datasets to lazyload DB ** inst ** tests ** preparing package for lazy loading Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package called 'assertthat' ERROR: lazy loading failed for package 'ggplot2'
  • removing 'C:/Users/Cha/Documents/R/win-library/3.3/ggplot2'
  • restoring previous 'C:/Users/Cha/Documents/R/win-library/3.3/ggplot2' Error: Command failed (1 )

I think there is a problem from the install_github ??? What do you think ??

Here is my Namespace:

exportPattern("^[[:alpha:]]+")

importFrom(R6, R6Class)
importFrom(shinyjs, colourInput)
importFrom(shinyjs, delay)
importFrom(shinyjs, useShinyjs)
importFrom(gnumeric, read.gnumeric.sheet)
importFrom(abind, abind)
importFrom(tcltk2, tk2text)
importFrom(gdata, read.xls)
importFrom("readODS", read.ods)
importFrom("grDevices", "bmp", "colorRampPalette", "dev.off", "jpeg",
             "png", "rainbow", "tiff")
importFrom("graphics", "abline", "layout", "legend", "mtext", "par",
             "plot", "points", "rect", "text", "title")
importFrom("stats", "sd")
importFrom("utils", "read.table", "write.csv", "write.table")

import(shinydashboard, shiny, stringr, lmtest, reader, devtools, tcltk)

For me, it looks ok but what do you think ?

I looked at a lot of article on internet but I only found one message which is exactly the same than my case but it is not enough informative : Cannot install "flexdashboard package"

I am totally stuck at this point and I would like to have your help regarding this issue.

Thank you verrrrrry much in advance !!

CHa

Recently, I encountered a similar or maybe related issue. As it turned out, there was a bug in devtools install_github , missing the correct installation of dependencies, despite dependecies=TRUE . Have a look at: Does install_github recursively install dependencies? If the problem persists, better contact the authors directly via their github repository.

Plus, I just observed another issue arising after a Windows update, during which permissions seemed to have been altered to download or update packages into personal Win User libraries instead of the "default" R library folder. I suspect devtools seemed consequently lost as to which packages were loaded or available at which versioning. A fresh R reinstallation (ie, library folder cleansing) solved that issue, but such may not always be convenient.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM