devtools

r devtools test() errors but testthat test_file() works

淺唱寂寞╮ 提交于 2019-12-01 19:08:48
问题 I have a function in a package I'm building that assigns a hex-code to the global environment for use by analysts... optiplum<-function(){ assign( x="optiplum", value=rgb(red=129,green=61,blue=114, maxColorValue = 255), envir=.GlobalEnv) } My unit test code is: test_that("optiplum - produces the correct hex code",{ optiplum() expect_true(identical(optiplum,"#813D72")) }) When I run the code manually, there isn't an error: > str(optiplum) chr "#813D72" > str("#813D72") chr "#813D72" >

r devtools test() errors but testthat test_file() works

隐身守侯 提交于 2019-12-01 18:54:50
I have a function in a package I'm building that assigns a hex-code to the global environment for use by analysts... optiplum<-function(){ assign( x="optiplum", value=rgb(red=129,green=61,blue=114, maxColorValue = 255), envir=.GlobalEnv) } My unit test code is: test_that("optiplum - produces the correct hex code",{ optiplum() expect_true(identical(optiplum,"#813D72")) }) When I run the code manually, there isn't an error: > str(optiplum) chr "#813D72" > str("#813D72") chr "#813D72" > identical("#813D72",optiplum) [1] TRUE > expect_true(identical(optiplum,"#813D72")) When I run a test_file() is

How to make R package recommend a package hosted on GitHub?

ε祈祈猫儿з 提交于 2019-12-01 17:35:45
I'm developing an R package that works as a wrapper for functions from the parallel and Rhpc packages called ctools . I know that if I want my package to require these packages I need to include them in the Imports section of the DESCRIPTION file. When installing my package, these packages will be installed from CRAN. Similarly I can put them in the Suggests section if they aren't required, but useful. These won't be installed with my package. But, I've forked the Rhpc package and added a function that I use in my ctools package. How do I get my package to Suggest/Import this package from my

Can't use Rcpp engine in R Markdown

大憨熊 提交于 2019-12-01 16:50:38
I tried to Knit HTML the following Rmd file: --- title: "Untitled" author: "Florian Privé" date: "12 septembre 2016" output: html_document --- ```{r fibCpp, engine='Rcpp'} #include <Rcpp.h> // [[Rcpp::export]] int fibonacci(const int x) { if (x == 0 || x == 1) return(x); return (fibonacci(x - 1)) + fibonacci(x - 2); } ``` I got the following error: Building shared library for Rcpp code chunk... Warning message: l'exécution de la commande 'make -f "C:/PROGRA~1/R/R-33~1.1/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-33~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB

How to make R package recommend a package hosted on GitHub?

情到浓时终转凉″ 提交于 2019-12-01 16:32:22
问题 I'm developing an R package that works as a wrapper for functions from the parallel and Rhpc packages called ctools. I know that if I want my package to require these packages I need to include them in the Imports section of the DESCRIPTION file. When installing my package, these packages will be installed from CRAN. Similarly I can put them in the Suggests section if they aren't required, but useful. These won't be installed with my package. But, I've forked the Rhpc package and added a

Dependency package “package_name” not available

∥☆過路亽.° 提交于 2019-12-01 15:53:50
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 available. Calls: suppressPackageStartupMessages ... <Anonymous> -> load_all -> load_depends -> mapply ->

I can't load devtools in R 3.2.0

喜夏-厌秋 提交于 2019-12-01 13:11:41
I am developping R packages with Rstudio. Until now, I used R 3.1.2 and all worked fine. Recently I have updated R to 3.2.0 version and I have updated the packages too. Now, when loading devtools: > library(devtools) Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'C:/Documents and Settings/cruiz.CREAL/Mis documentos/R/win-library/3.2/git2r/libs/i386/git2r.dll': LoadLibrary failure: No se encontró el proceso especificado. Error: package or namespace load failed for ‘devtools’ I have reinstalled devtools and git2r with biocLite and with install.packages

making change to function in R package and installing on Ubuntu

依然范特西╮ 提交于 2019-12-01 12:57:44
问题 Short question: I want to edit the postgresqlWriteTable function in the RPostgreSQL package and install it on R running on an Ubuntu machine. Long explanation: The root of my problem is that I am trying to write to a postgres table with an auto-incrementing primary key column from R using dbWriteTable from RPostgreSQL package. I read this post: How do I write data from R to PostgreSQL tables with an autoincrementing primary key? which suggested a fix to my problem by changing the function

I can't load devtools in R 3.2.0

走远了吗. 提交于 2019-12-01 11:58:44
问题 I am developping R packages with Rstudio. Until now, I used R 3.1.2 and all worked fine. Recently I have updated R to 3.2.0 version and I have updated the packages too. Now, when loading devtools: > library(devtools) Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'C:/Documents and Settings/cruiz.CREAL/Mis documentos/R/win-library/3.2/git2r/libs/i386/git2r.dll': LoadLibrary failure: No se encontró el proceso especificado. Error: package or namespace

“Could not find function” in Roxygen examples during CMD check

浪尽此生 提交于 2019-12-01 04:51:23
I'm running a CMD check on a package in RStudio, part of which analyses the @examples in the inline Roxygen documentation. I'm getting this error: checking examples ... ERROR Running examples in ‘packagename-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: checkDate > ### Title: Ensure that a date string is a valid date > ### Aliases: checkDate > > ### ** Examples > > checkDate("2017-05-06") Error: could not find function "checkDate" Within my .R file, the documentation is defined as: #' Ensure that a date string is a valid