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
5
votes
2 answers

R package with both .c and .cpp files with Rcpp

I'm trying to build an R package which contains both C (in the form of .c files) and C++ code (in the form of .cpp files) using the Rcpp package as a dependency. I have a couple of questions. First, is it actually possible to do this? Can one call…
5
votes
1 answer

Can't install R package in docker image

Since couple of days I've been encountering problems with installing R packages during docker image build: > install.packages("devtools", repos = "https://mran.microsoft.com/snapshot/2018-10-25") Installing package into…
Taz
  • 5,755
  • 6
  • 26
  • 63
5
votes
1 answer

R 3.5 package ‘lattice’ was installed by an R version with different internals

I updated R 3.4.4 to R 3.5.0 today. And my package cannot pass R CMD check anymore. It fails at checking whether package can be installed ... ERROR. In another hand my package works, I can install it and use it as long as I don't check it. The error…
JRR
  • 3,024
  • 2
  • 13
  • 37
5
votes
2 answers

Downloading new data from internet when package is loaded every time

I have a package that scrapes data from the internet and displays its content based on the function call. But recently I got a message from CRAN that the data becomes stale when Binary build is installed (since the function was mentioned in utils.R…
amrrs
  • 6,215
  • 2
  • 18
  • 27
5
votes
1 answer

R: package vignette not built

Problem I created a small internal package for my company. To describe hot to use it, I wrote a vignette. But for some reason, the vignette is not built when I hit Install and Restart in RStudio. Further Information I use roxygen for the package…
der_grund
  • 1,898
  • 20
  • 36
5
votes
1 answer

How do i keep source files when using R's devtools library function 'install'

I am trying to build an R package (DESeq2) from source so that I can debug it. I've installed all the dependencies required and I'm following Hillary Parker's instructions for creating R packages. I'm running this on CentOS 6.6 using R-3.4.2. I run…
irritable_phd_syndrome
  • 4,631
  • 3
  • 32
  • 60
5
votes
1 answer

How to store frequently used data or parameters within an R package?

I am authoring an R package and there are several numerical vectors that users will frequently use as arguments to various package functions. What would be the best way to store these vectors within the package so that users can easily access…
Jeffrey Girard
  • 761
  • 4
  • 20
5
votes
1 answer

Travis CI R package oldrel error: no output received in the last 10 minutes

I recently hooked up a github repo containing an R package to Travis CI. The package is building fine with current release (release) and development release (devel) of R, but gives an error with the old release (oldrel, i.e., R version 3.2.5). The…
Ladislas Nalborczyk
  • 725
  • 2
  • 5
  • 20
5
votes
1 answer

Error: pandoc document conversion failed with error 2 with pkgdown / rmarkdown

I'm trying to build a website with pkgdown so I ran pkgdown::build_site(). This throws the following error: Building article 'index.html' Error: pandoc document conversion failed with error 2 There was a similar problem on SO but the answer didn't…
epo3
  • 2,991
  • 2
  • 33
  • 60
5
votes
1 answer

Compilation error using Rcpp with typedef

I'm writing some C++ components for my R package using RcppEigen and I'm having trouble using typedefs in this context. The following code won't compile: // [[Rcpp::depends(RcppEigen)]] #include using namespace Rcpp; typedef…
ixpl
  • 259
  • 1
  • 8
5
votes
0 answers

Is there an equivalent of `pip install -e` in R?

From python pip install -h: -e, --editable Install a project in editable mode (i.e. setuptools "develop mode") from a local project path or a VCS url. Basically , if you pip install -e , pip…
naught101
  • 18,687
  • 19
  • 90
  • 138
5
votes
1 answer

Rcpp: C++ functions don't work in R package

I have some functions in R and I re-coded them by Rcpp. Each of those functions has a stand-along .cpp file. One function called add_inflow(). Previously, I put all cpp functions on my desktop and used Rcpp::sourceCpp("add_inflow.cpp"). Then, this…
Bratt Swan
  • 1,068
  • 3
  • 16
  • 28
5
votes
1 answer

Export a list of functions with roxygen2

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…
egnha
  • 1,157
  • 14
  • 22
5
votes
1 answer

How to view package license file?

I have a package called my_pkg and in my DESCRIPTION file I've declared my license as License: file LICENSE. Another question suggested using packageDescription to call the license, but that yields the following: > packageDescription('my_pkg',…
nev
  • 297
  • 3
  • 13
5
votes
2 answers

Copy .rmd file included in a Rstudio addin package to a user defined directory

I have a rstudio addin package located here. One of the addins allows the user to define a directory and it will copy a file that is located in the package to that directory. the file is…
Andrew Taylor
  • 3,438
  • 1
  • 26
  • 47