Questions tagged [r-package]

This tag should be used for questions regarding the development of R packages. Do not use this tag to ask questions about the use of R packages. Many common R packages have their own tags for that purpose.

This tag should be used for questions regarding the development of R packages. Do not use this tag to ask questions about the use of R packages. Many common R packages have their own tags for that purpose.

The R Core Team defines a package in the Manual on Writing R Extensions:

A package is a directory of files which extend R, a source package (the master files of a package), or a tarball containing the files of a source package, or an installed package, the result of running R CMD INSTALL on a source package. On some platforms (notably OS X and Windows) there are also binary packages, a zip file or tarball containing the files of an installed package which can be unpacked rather than installing from sources.

1279 questions
11
votes
4 answers

What is the MD5 file in R packages used for? How is it generated?

I have noticed a file called 'MD5' is present in the directories of many R packages that I have downloaded. However I can not find a mention of this in the 'Writing R Extensions' manual. It lists the MD5 hash and filename for different files in the…
Matthew Lueder
  • 953
  • 2
  • 12
  • 25
11
votes
1 answer

Stop R package build & reload from backing up and resuming R session

I am writing an R package in Rstudio on Windows 10. Every time I reload the package, a note comes up: "Backing up R session" and then "Resuming R session". This takes a bit of time (about 8 or 9 seconds out of a total package build time of 14…
user2506086
  • 503
  • 2
  • 10
11
votes
3 answers

Data Deprecation in R-package

In one of my R-packages I have some silly example data that I would like to remove. For that I'd like to follow the common way first to deprecate and then defunct it. For removing functions from an R-package I found a way like this: oldFunc <-…
Daniel Fischer
  • 3,280
  • 1
  • 18
  • 29
10
votes
1 answer

What is causing "Must request at least one colour from a hue palette" error in my R package only on linux-based builds?

I am currently checking some code for cross-platform compatibility. I am using Travis-CI to build my R package under ubuntu on GitHub commits. If I eliminate this one single part, it successfully builds, but if I include this code, I receive the…
Adam Price
  • 810
  • 2
  • 11
  • 21
10
votes
1 answer

Writing `configure` file for an r package

I am writing an r package which provides a wrapper around the libSBML C library. I am using the rcppgsl package as a reference, which looks for the location of header files and the library files for GNU Scientific Library GSL and uses that…
Satya
  • 1,708
  • 1
  • 15
  • 39
10
votes
1 answer

Package build ignores Makevars flags

Question I'm trying to tell my package to use gcc to compile the C++ code in stead of clang. Why aren't my CXX flags in my Makevars file being used? (I am expecting/hoping the solution to be something really simple that I've overlooked.) It's my…
SymbolixAU
  • 25,502
  • 4
  • 67
  • 139
10
votes
2 answers

rmarkdown::render in parallel

I have the R package, one of its function - produce report. In the inst/markdown I have a template rep.rmd. In the package function ProduceReport() I have this code: render.file <-"rep.Rmd" render.file <- system.file(TEMPLATES.PATH, render.file,…
Stanislav
  • 551
  • 7
  • 21
10
votes
1 answer

Where to create package environment variables?

I'm doing a data analysis and created a package to store my vignettes and data, as explained here. I want to set some variables that would be available to all my package functions. These variables define: the path to data sets, the measurements…
Ben
  • 6,321
  • 9
  • 40
  • 76
10
votes
1 answer

What kind of license is the best license for an R package?

I am reading about licenses. What kind of license is the best license for an R package? I do like Creative Commons a lot but it is not recommended for software. Their own website says "We recommend against using Creative Commons licenses for…
pachadotdev
  • 3,345
  • 6
  • 33
  • 60
10
votes
2 answers

r - data.table and testthat package

I am building a package which works with data.table and which should be tested using package testthat. While the code works fine when calling from the command line, I run into issues when calling from a test case. It seems that the [] function from…
utal
  • 101
  • 4
10
votes
1 answer

Indicate that R package is proprietary

Is there a standard way how to indicate that R package is proprietary, owned by a company and should not be shared outside of the company? Right now, I am using this in DESCRIPTION file: License: Proprietary, ownership of XX Company
Tomas Greif
  • 21,685
  • 23
  • 106
  • 155
9
votes
2 answers

Finding objects from other packages' namespaces in package code

I'm refactoring a package that imports many other packages' full namespaces. I believe that many of these dependencies are used for single function call uses that would be better handled using importFrom, or are orphaned dependencies that are no…
bcarlsen
  • 1,381
  • 1
  • 5
  • 11
9
votes
1 answer

CRAN Solaris: caught segfault *** address cause 'invalid permissions'

In my package {bigstatsr}, I get this error for CRAN checkings when testing on Solaris (see https://www.r-project.org/nosvn/R.check/r-patched-solaris-x86/bigstatsr-00check.html). I managed to reproduce this issue using rhub::check_on_solaris(). By…
F. Privé
  • 11,423
  • 2
  • 27
  • 78
9
votes
1 answer

NAMESPACE option created by RcppArmadillo.package.skeleton causes error

I'm creating a R package that contains Rcpp functions depending on RcppArmadillo, so I first generate the package skeleton by RcppArmadillo.package.skeleton. However, when I roxygenize my package, it gives me an error shown below. R…
inmybrain
  • 386
  • 3
  • 16
9
votes
1 answer

Build an R package tarball without divulging your user name in the tarball

In R CMD build, the ID of the user is automatically inserted into the DESCRIPTION file. This is problematic because I work in a corporate computing environment and I do not want to divulge my user ID. Reproducible example: git clone…
landau
  • 5,636
  • 1
  • 22
  • 50