rstudio / rstudio/packrat

Building a package with Rstudio fails to load the package while using packrat

Open
#242 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
409
Forks
89
PR merge metrics
No merged PRs in 30d

Description

After initializing packrat, when I try to build the R package that I'm developing, Rstudio fails to load the package. This has a clear explanation, while the package is installed in the packrat directory, the packrat directory is not among the locations where library looks at.

In other words, after pressing Ctrl + Alt + b, I see the following messages

Build window:

==> roxygen2::roxygenize('.', roclets=c('rd', 'collate', 'namespace', 'vignette'))

Updating vignettes
Documentation completed

==> R CMD INSTALL --no-multiarch --with-keep.source autoreport

* installing to library ‘/home/george/Documents/scj/productos/autoreport/packrat/lib/x86_64-pc-linux-gnu/3.2.2’
* installing *source* package ‘autoreport’ ...
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (autoreport)

Console:

Restarting R session...

> library(autoreport)
Error in library(autoreport) : there is no package called ‘autoreport’
```r

Session info

```r
R version 3.2.2 (2015-08-14)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.3 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] tools_3.2.2   packrat_0.4.4
> .libPaths()
[1] "/home/george/Documents/scj/productos/autoreport/packrat/lib/x86_64-pc-linux-gnu/3.2.2"
[2] "/home/george/Documents/scj/productos/autoreport/packrat/lib-ext"                      
[3] "/home/george/Documents/scj/productos/autoreport/packrat/lib-R"  

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the package build with RStudio's Ctrl + Alt + B using the reported R 3.2.2 and packrat setup. Start with the build output, the subsequent library(autoreport) failure, and .libPaths() to trace where the package is installed versus where the session looks. Done means the package built through packrat can be loaded in the restarted R session.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.