cran

Executing R scripts during package installation

牧云@^-^@ 提交于 2020-02-03 04:52:07
问题 Hopefully this has a straightforward answer, but I haven't been able to find it as yet. I'm writing an R package, and when installed on Windows I want it to execute a script that searches for a system file i.e. list.files(path = "C:/Program Files/, ...) and then saves that path to the package directory as a text file for later reference. I tried saving the script as src/install.libs.R but that stopped my package from building. In case there is an alternative solution, I'm trying to save the

R: “make” not found when installing a R-package from local tar.gz

喜夏-厌秋 提交于 2020-01-30 05:54:25
问题 The R Package ConvCalendar is not on Cran repository anymore (see here). However, because I have intensively used this package for previous projects, it would be nice to have it installed on my machine, even an older version would suffice. (Windows 10 environment) In the link above it is possible to download older versions of ConvCalendar from the archive. I thus did it, and tried installing it by running (having devtools also installed and loaded): install.packages("ConvCalendar_1.2.tar.gz",

Where is the code for recycling `rbinom` inputs?

徘徊边缘 提交于 2020-01-25 04:05:27
问题 From the documentation, rbinom takes three arguments, n , size , and prob . The answer to this question states that if prob is a vector, it is recycled until n is reached. I want to find that code! The R source immediately calls a C function: > rbinom function (n, size, prob) .Call(C_rbinom, n, size, prob) <bytecode: 0x113526220> <environment: namespace:stats> Searching the Github mirror for R gets me the this rbinom C function, but it only takes two arguments. Where is n ? Where is the

selecting CRAN mirror from remote device

拈花ヽ惹草 提交于 2020-01-24 23:42:07
问题 I am running jobs remotely, and the cluster I am running it on does not have the R package I require. I have tried to install it using: if(!require(hglm)){install.packages("hglm");require(hglm)} and realise that I am required to select a CRAN mirror. I tried adding: selectCRANmirror() to the script, but received the error message, cannot select CRAN mirror non-interactively. I then tried adding: selectCRANmirror(ind=72) as this is what I would use on my local computer to set the CRAN mirror

pandoc: Could not fetch http://www.r-pkg.org/badges/version/package TlsExceptionHostPort (HandshakeFailed

我是研究僧i 提交于 2020-01-23 16:45:28
问题 When running R CMD check package_0.1.0.tar.gz --as-cran I see the following warning * checking top-level files ... WARNING Conversion of ‘README.md’ failed: pandoc: Could not fetch http://www.r-pkg.org/badges/version/package_name TlsExceptionHostPort (HandshakeFailed (Error_Misc "user error (unexpected type received. expecting handshake and got: Alert [(AlertLevel_Fatal,HandshakeFailure)])")) "www.r-pkg.org" 80 I can see some answers (e.g. here) but it seems they are by windows users (I'm on

CRAN policy on use of global variables

心不动则不痛 提交于 2020-01-15 05:24:08
问题 In the CRAN repository policy documentation, it is explicitly stated: "Packages should not modify the global environment (user’s workspace)." When I run R CMD check via devtools::check(), it merely states "no visible binding for global variable x." as a NOTE rather than a WARNING. CRAN will not accept user-contributed packages containing ERRORS and/or WARNINGS. My package has none of these. NOTES, on the other hand, are admissible. This said, I have a few assign(..., envir = .GlobalEnv)

R CMD check does not respect selective code evaluation in knitr code chunks

天涯浪子 提交于 2020-01-13 09:14:08
问题 I am building a package in R 3.1.0 on Windows 7 32-bit (and also on a different machine running Windows 8 64bit) and I am using knitr to write vignettes using Markdown. I am hoping to publish this package on CRAN so I am using R CMD check to check that my demos, datasets and vignettes all behave properly. I keep my vignettes as .Rmd files (rather than making them outside of the package building process and stashing them in inst/doc) because they serve as extra tests on my package and aren't

How to create CRAN ready R package that has external dependency libxml2

橙三吉。 提交于 2020-01-13 05:13:48
问题 I have created an R package that I would like to submit to CRAN. It contains code that needs to be compiled in plain C and this code depends on the libxml2 library. My current solution is to let Linux and Mac users install the libxml2-dev package, which lets them compile and install the R source package. For Windows, I have created a special binary R-package that contains the required binary dependency. When reading the CRAN guidelines I see that only source packages may be uploaded and that

CRAN Package submission - R CMD Checks

落爺英雄遲暮 提交于 2020-01-13 04:16:07
问题 I was building a package that I wanted to submit to CRAN. I completed R CMD checks (using devtools::check()) and ensured that I fix all errors, warnings and notes before I build my package (devtools::build) and then submit the resulting tar.gz file to CRAN. However, apparently, the package failed the R CMD checks at CRAN (There was one note and one error, as per their mail). Now my question was, why wasn't this picked up when I ran the checks at my end? To provide some specifics - One of the

Skip tests on CRAN, but run locally

百般思念 提交于 2020-01-12 05:35:07
问题 It there an easy way to skip the execution of some tests in a package if the package is tested by CRAN? The background is, I like to have a lot of tests and in sum they are time consuming (not good for CRAN). I know there is testthat::skip_on_cran() but I do not want to use package testthat to avoid another dependency. I am looking for an el-cheapo way to mimic testthat::skip_on_cran . Ideally, I would like to have a testfile in directory pkg/tests that calls the tests (testfiles) and