r-package

Error during build and reload in R

可紊 提交于 2019-12-12 05:29:19
问题 I am roxygenizing a package I am making in R. The script is #' HandyTools #' #' Check if required packages are installed or not and installs them if not #' @param packageList - a list containing the required package names #' #' @examples #' checkPackagesLibrary(c("lme4","epitools","roxygen2")) #' #' @export library(devtools) checkPackagesLibrary <- function(packagesList){ new.packages <- packagesList[!(packagesList %in% installed.packages(lib.loc="/data/legacy/user/R_Packages")[,"Package"])]

R package that delivers executables residing in /inst

不羁的心 提交于 2019-12-12 05:03:52
问题 I would like to create an R package that relies on executables that I put into the /inst folder. However, whatever I put in /inst loses the execution bit after the package is installed, hence the binaries become non-executable due to the missing bit. Is there a way to preserve the file mode for files in /inst or these execution bits need to be added post installation? If so, anyone knows how? Appreciate any inputs 来源: https://stackoverflow.com/questions/47304933/r-package-that-delivers

R packages: “Error: object 'compute' not found whilst loading namespace ..”

佐手、 提交于 2019-12-11 15:54:17
问题 My directory structure is as follows: c:/Users/bob/MyPackageName c:/Users/bob/MyPackageName/R c:/Users/bob/MyPackageName/tests c:/Users/bob/MyPackageName/tests/testthat My development session normally consists of starting an R session in the package root ( c:/Users/bob/MyPackageName ), and running devtools::load_all() devtools::test() followed by alternating the addition of little bits in MyPackageName/tests/testthat/mytest.R and in MyPackageName/R/mycode.R . When starting a session returns

Workaround to allow badges in package README.md on github but not in CRAN version

只愿长相守 提交于 2019-12-11 15:33:24
问题 R CMD check packagename_0.1.1.tar.gz --as-cran produces a WARNING if badges are present in README.md . This causes consequences like travis CI to fail (since it treats warnings as errors) Is there a workaround to get the check to pass without removing the badges? 来源: https://stackoverflow.com/questions/56346524/workaround-to-allow-badges-in-package-readme-md-on-github-but-not-in-cran-versio

R package: Adding a vignette causes 'undefined exports'

左心房为你撑大大i 提交于 2019-12-11 15:23:50
问题 I wrote an internal package and when I add a vignette, it does not pass devtools:check() anymore. I added the vignette with devtools::use_vignette("my-vignette") . Even if I do not change anything about the vignette template, running devtools::check() yields: ==> devtools::check() Updating DataReportR documentation Loading DataReportR Setting env vars -------------------------------------------------------------- CFLAGS : -Wall -pedantic CXXFLAGS: -Wall -pedantic Building DataReportR --------

Package that suggests `parallel` fails compile in windows

别来无恙 提交于 2019-12-11 07:43:39
问题 I am developing a package that suggests R's parallel package (So my DESCRIPTION has a Suggests: parallel (>= 1.13.1) statement. It compiles fine under OSX and Linux but fails when building on windows (using win-builder). Here is the end of the install.log that win-builder spits out: *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded *** arch - i386 Error: package or namespace load failed for 'spectrolab' in library

How can I force R to include contributors (or other roles) in my package's citation() output?

十年热恋 提交于 2019-12-11 06:12:38
问题 I'm currently writing my first R package, following Hadley Wickham's excellent book on the topic. The section of the book linked above includes examples for adding authors through the package's DESCRIPTION file. Dr. Wickham notes that "The full list of roles is extremely comprehensive. Should your package have a woodcutter ('wdc'), lyricist ('lyr') or costume designer ('cst'), rest comfortably that you can correctly describe their role in creating your package." The problem that I'm

Package dependency error “there is no package called ‘stringi’”

谁都会走 提交于 2019-12-11 05:08:13
问题 I created an R package and loaded it to github (microdadosBrasil). When I try to install the package (as a user would) I get the following error: devtools::install_github("lucasmation/microdadosBrasil") Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package called ‘stringi’ I tried solving this by adding stringi to the package dependencies In DESCRIPTION in included: Imports: stringi I also included the package import at NAMESPACE import(stringi) But,

Can't install deSolve pacakge in R, Library not loaded: libgcc_s.1.dylib

痞子三分冷 提交于 2019-12-11 04:59:47
问题 I am using MacOSX sierra, I installed fortrun using brew: brew install gcc brew update && brew reinstall r brew link --overwrite r Now I need to install deSolve but I can't: > install.packages("deSolve") Installing package into '/usr/local/lib/R/site-library' (as 'lib' is unspecified) trying URL 'https://cran.rstudio.com/src/contrib/deSolve_1.21.tar.gz' Content type 'application/x-gzip' length 2172444 bytes (2.1 MB) ================================================== downloaded 2.1 MB dyld:

Export a list of functions with roxygen2

情到浓时终转凉″ 提交于 2019-12-11 01:38:47
问题 Problem — I want to export a list of functions as part of an R package, ideally using roxygen2. To be more precise, I want to export the functions in the list, rather than the list itself. For example, consider a list of functions that are generated as closures, like so: addval <- 1:100 fns <- lapply(addval, function(y) {force(y); function(x) x + y}) names(fns) <- paste0("add_", addval) Then the problem is to bind the functions (using the same names in fns , for instance) to the package