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:
- Download the package : https://cran.r-project.org/src/contrib/devtools_1.13.5.tar.gz
- Extract the package.
- Edit the R/run-source.r file to fix the bug. (Just swap the lines "which
- 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.
- Uninstall all installed packages of R. (I have deleted the folder ~/R/x86_64-pc-linux-gnu-library completely)
- 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")
- This command will return error : ERROR: dependencies ‘httr’, ‘memoise’, ‘whisker’, ‘digest’, ‘rstudioapi’, ‘jsonlite’, ‘git2r’, ‘withr’ are not available for package ‘devtools’
- Install all dependencies one by one. (install.packages("httr") install.packages("memoise") ...)
- 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")
- You are done.
keyword : "Error in r_files[[which]] : invalid subscript type 'closure'"
Hiç yorum yok:
Yorum Gönder