4 Mart 2018 Pazar

devtools package of R

How to install bugfree devtools package to R, in Linux?

Current version (1.13.5) of devtools package unfortunately has a trivial, but need to be fixed, bug.

the R/run-source.r file, in the end has such a part :

  } else {
    if (length(r_files) > 1) {
      warning("Multiple R files in gist, using first.")
      which <- 1
    }
  }
  r_files[[which]]$raw_url
}

but it should be :

  } else {
    if (length(r_files) > 1) {
      warning("Multiple R files in gist, using first.")
    }
    which <- 1
  }
  r_files[[which]]$raw_url
}

After installation, I couldn't find how to fix it. So I have followed these steps:



  1. Download the package : https://cran.r-project.org/src/contrib/devtools_1.13.5.tar.gz
  2. Extract the package.
  3. Edit the R/run-source.r file to fix the bug. (Just swap the lines "which
  4. After doing that, md5sum of the file is changed. Calculate the new md5sum (with the command "md5sum run-source.r") and update the file "MD5", changing the line "a861a5eb5ec4cb26572b7f11e86c4046 *R/run-source.r" with correct md5sum of the file.
  5. Uninstall all installed packages of R. (I have deleted the folder ~/R/x86_64-pc-linux-gnu-library completely)
  6. Then install devtools package from your local, using the command : install.packages("the/full/path/devtools_1.13.5.tar.gz", repos = NULL, type="source")
  7. This command will return error : ERROR: dependencies ‘httr’, ‘memoise’, ‘whisker’, ‘digest’, ‘rstudioapi’, ‘jsonlite’, ‘git2r’, ‘withr’ are not available for package ‘devtools’
  8. Install all dependencies one by one. (install.packages("httr") install.packages("memoise") ...)
  9. After installing all dependencies, try again to install devtools from your local :  install.packages("the/full/path/devtools_1.13.5.tar.gz", repos = NULL, type="source")
  10. You are done.
keyword : "Error in r_files[[which]] : invalid subscript type 'closure'"

Hiç yorum yok: