devtools

Listening console.log

五迷三道 提交于 2020-01-09 10:25:07
问题 I want to set a listener for console.log() and do something with the message without preventing the default behaviour. So, the console of the dev tools should get the message as well. Any ideas? 回答1: Never tried this in a webpage, but it work in a browser plugin (where javascripts rights are are not the same for security reasons). You could definitively go for something like this : (function(){ var originallog = console.log; console.log = function(txt) { // Do really interesting stuff alert(

“object not found” during package build/install

穿精又带淫゛_ 提交于 2020-01-06 06:04:15
问题 I'm at a loss to debug building/installing a package. Building a package "MyProjekt" through > devtools::build("MyProjekt") works fine, even though > devtools::document() Updating MyProjekt documentation Loading MyProjekt Error: object 'rank' not found whilst loading namespace 'MyProjekt' fails. Attempting to install the built (pure R) package > install.packages(pkgs="./MyProjekt.tar.gz") ... Error: package or namespace load failed for 'MyProjekt': object 'rank' not found whilst loading

“object not found” during package build/install

╄→尐↘猪︶ㄣ 提交于 2020-01-06 06:03:05
问题 I'm at a loss to debug building/installing a package. Building a package "MyProjekt" through > devtools::build("MyProjekt") works fine, even though > devtools::document() Updating MyProjekt documentation Loading MyProjekt Error: object 'rank' not found whilst loading namespace 'MyProjekt' fails. Attempting to install the built (pure R) package > install.packages(pkgs="./MyProjekt.tar.gz") ... Error: package or namespace load failed for 'MyProjekt': object 'rank' not found whilst loading

Installing R package from github returns non-zero exit status error; GSL and Rtools correctly installed

穿精又带淫゛_ 提交于 2020-01-05 12:40:49
问题 I'm attempting to install the mvabund package from github here on Windows 10 in R 3.5.1 (The github version has functions not yet available in the cran versions.): https://github.com/aliceyiwang/mvabund I've installed Rtools, using the instructions for another package here: https://cran.r-project.org/web/packages/dynr/vignettes/InstallationForUsers.pdf and all the checks there indicate that GSL and RTools are installed properly. However, when I try to install the package with devtools, it

Installing R package from github returns non-zero exit status error; GSL and Rtools correctly installed

≡放荡痞女 提交于 2020-01-05 12:39:10
问题 I'm attempting to install the mvabund package from github here on Windows 10 in R 3.5.1 (The github version has functions not yet available in the cran versions.): https://github.com/aliceyiwang/mvabund I've installed Rtools, using the instructions for another package here: https://cran.r-project.org/web/packages/dynr/vignettes/InstallationForUsers.pdf and all the checks there indicate that GSL and RTools are installed properly. However, when I try to install the package with devtools, it

Cannot install proprietary R library

不问归期 提交于 2020-01-03 04:46:29
问题 I have developed my own R library (called HAM) When I use the install() command from the library roxygen2 , the result looks as shown below: * installing *source* package 'HAM' ... ** R ** preparing package for lazy loading Warnung: package 'car' was built under R version 3.1.2 Warnung: package 'gmm' was built under R version 3.1.2 Warnung: package 'MASS' was built under R version 3.1.2 Warnung: package 'fAssets' was built under R version 3.1.2 Warnung: package 'timeDate' was built under R

r sourcing private repos from github

血红的双手。 提交于 2020-01-01 12:27:06
问题 Hi I was wondering how to source private repos in github that I have been given access to. Using the devtools package, it is easy enough to source open repos by using commands such as: source_url('https://raw.github.com/hadley/stringr/master/R/c.r') but doing the equivalent with the URL for a private repo doesn't seem to work. P.S. I know I can clone the whole repo, and then get the file that way, but I'm looking for just one specific file in the whole repo to take, and it's a bit inefficient

Build & Reload in RStudio on Windows: devtools::document() says devtools not found

偶尔善良 提交于 2020-01-01 02:28:27
问题 When I click "Build & Reload" on the Build tab within RStudio, I get the following error: ==> devtools::document(roclets=c('rd', 'collate', 'namespace')) Error in loadNamespace(name) : there is no package called 'devtools' Calls: suppressPackageStartupMessages ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> Execution halted Exited with status 1. But when I just enter devtools::document(roclets=c('rd', 'collate', 'namespace')) directly into the console, it works. In addition, if I

Redirect system2 stdout to a file on windows

一世执手 提交于 2019-12-31 01:52:07
问题 According to the manual, the stdout argument of the system2 function can redirect output to a file. This seems to work on unix, however I can't get it to work on windows. The toy example below, no out.txt or err.txt files are created. I tried sending it to an existing file, or expand the full file path, but with no success: setwd(tempdir()) system2("whoami", stdout="out.txt", stderr="err.txt") file.exists("out.txt") Am I doing something wrong or is this a limitation in system2 ? 回答1: I'm

Dependency package “package_name” not available

匆匆过客 提交于 2019-12-30 17:47:07
问题 I'm getting a strange error when trying to build and reload in RStudio. In my description file I've included a package that I have built and maintain within my organization. It's not on CRAN. Essentially, when I update the DESCRIPTION file (Depends: ...), I get this error: ==> devtools::document(roclets=c('rd', 'collate', 'namespace', 'vignette')) Updating fczstudy documentation Loading fczstudy Error in (function (dep_name, dep_ver = NA, dep_compare = NA) : Dependency package surv3 not