devtools

Configuration failed to find libgit2 library

江枫思渺然 提交于 2021-02-19 07:34:19
问题 When attempting to install the R devtools package (on Linux Mint, 19.3 & R 4.0.2),I receive this error. In the ANTICONF section the message offers some suggestions for what I should do, but being new to Linux I don't understand how to implement the instructions, and my search of the internet has not yielded fruit. Could someone offer guidance on the commands/steps I need to take to install libgit2 or resolve this issue? > install.packages("devtools") Installing package into ‘/home/xilliam/R

How do I fix a “System command error” when running “devtools::build_vignettes()” in R?

泪湿孤枕 提交于 2021-02-08 10:18:40
问题 I am developing a package. The “.Rmd” files already exist in the “./vignettes” folder in the root directory of the package. I want to automatically create “.html” and “.pdf” documents into./inst/doc, so run the following code: library("devtools") build_vignettes Then Errors occurred: Building PhosMap vignettes Error in (function (command = NULL, args = character(), error_on_status = TRUE, : System command error Error in (function (command = NULL, args = character(), error_on_status = TRUE, :

Unload a package and all dependencies

我怕爱的太早我们不能终老 提交于 2021-02-04 15:08:47
问题 I am trying to unload a package with all of its dependencies. The problem that I am running into is the order in which to unload dependencies. Because dependencies are recursive, they can only be unloaded from bottom-up in the dependency tree. Is there an easy or native way in R to accomplish this? Below a first go in what I would like to accomplish: eval_current <- function(expr, envir=parent.frame(), timeout=60){ #set the timeout setTimeLimit(elapsed=timeout, transient=TRUE); #currently

Unload a package and all dependencies

守給你的承諾、 提交于 2021-02-04 15:08:20
问题 I am trying to unload a package with all of its dependencies. The problem that I am running into is the order in which to unload dependencies. Because dependencies are recursive, they can only be unloaded from bottom-up in the dependency tree. Is there an easy or native way in R to accomplish this? Below a first go in what I would like to accomplish: eval_current <- function(expr, envir=parent.frame(), timeout=60){ #set the timeout setTimeLimit(elapsed=timeout, transient=TRUE); #currently

Issue installing R package from github using devtools

旧巷老猫 提交于 2021-01-28 19:44:25
问题 In similar fashion to the following question: Error when using install_github: 'exdir' does not exist I cant seem to install packages from github using the devtools package, getting the following error on all packages I've tried (slidify, rCharts, rga, magrittr etc...): Error in unzip(src, list = TRUE) : zip file 'C:/Users/.../Rtemp\RtmpGIlGBA/master.zip' cannot be opened In addition: Warning messages: 1: In unzip(src, exdir = target, unzip = getOption("unzip")) : error 1 in extracting from

Getting an error installing R package “withr” as a dependency for “ggplot2”. How can I fix this?

拈花ヽ惹草 提交于 2021-01-28 18:54:31
问题 I'm working on a different computer than usual and so installing packages for the first time. Trying to install ggplot2 resulted in the following error. install.packages("ggplot2") also installing the dependency ‘withr’ trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/withr_2.3.0.tgz' Warning in install.packages : cannot open URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/withr_2.3.0.tgz': HTTP status was '404 Not Found' Error in download.file(url, destfile, method, mode =

Export S3 method for a 'function' class object

时光总嘲笑我的痴心妄想 提交于 2021-01-27 15:15:56
问题 Function objects seems to work well with dispatching of S3 methods. But for some reason they cannot be exported in NAMESPACE file. Below code works with dispatching to *.function method: as.abc = function(x, ...){ UseMethod("as.abc") } as.abc.list = function(x, ...){ stopifnot(is.list(x)) structure(x, class="abc") } as.abc.function = function(x, ...){ stopifnot(is.function(x)) structure(x, class="abc") } # list l = as.abc(list(1)) str(l) #List of 1 # $ : num 1 # - attr(*, "class")= chr "abc"

R package with private github dependency

我怕爱的太早我们不能终老 提交于 2021-01-27 04:13:08
问题 I'm developing an internal R package which is going to be stored and installed from github, but it depends on another R package which is also in a private repo. I know how to specify remote dependencies with the devtools Remotes: tag (vignette) and I know how to install private repositories using install_github(source, PAT) . But how do I do both? The idea is to have a server just install the package, and also install all of the dependencies on github. 回答1: Just putting @jeroen's response in

How to use devtools::use_data on a list of data frames?

狂风中的少年 提交于 2021-01-26 06:49:31
问题 I have a series of data frames that I want to save as individual .rda files in my package. I could use devtools::use_data(my.df1, my.df2...) but I don't have a named object for each data frame, they are all stored in a big list. What I would like is to do is to call use_data for each list element and use the list name for the .rda file name. But when I do the following, I have an error message: > lapply(my.list, devtools::use_data, overwrite = TRUE) Error: Can only save existing named objects

avoid checking examples for R package building using devtools

时光毁灭记忆、已成空白 提交于 2021-01-21 08:12:08
问题 I am using devtools to build my R package, and use the function check to check the package (with a long list of outputs on screen). However, because my package includes examples, and some of the examples are time-consuming, I am wondering how can I suppress checking examples when checking the package in devtools . The check function itself seems to not have such option. Thanks! 回答1: You need to set the args argument appropriately with command line arguments to R CMD check . The latter has -