rstudio / packrat

Packrat is a dependency management system for R
http://rstudio.github.io/packrat/
401 stars 89 forks source link

An error and warnings in initialization #553

Closed JohannesTan closed 5 years ago

JohannesTan commented 5 years ago

Hi

I got an error and warnings after executing packrat::init() as follows.

> packrat::init()
Initializing packrat project in directory:
- "~/docdis"
Error: Unable to retrieve package records for the following packages:
- "rethinking"
In addition: There were 15 warnings (use warnings() to see them)
> warnings()
 警告メッセージ: 
1: In fileDependencies.R(file) :
  Failed to parse C:/Users/yohei/Documents/docdis/model/ch3/修正前/run-model-treghapSNC_simpmatx2.R ; dependencies in this file will not be discovered.
2: In FUN(X[[i]], ...) :
  Package 'rethinking' not available in repository or locally
3: In FUN(X[[i]], ...) :
  Failed to infer source for package 'GGally'; using latest available version on CRAN instead
4: In FUN(X[[i]], ...) :
  Failed to infer source for package 'MCMCpack'; using latest available version on CRAN instead
5: In FUN(X[[i]], ...) :
  Failed to infer source for package 'MatrixModels'; using latest available version on CRAN instead
6: In FUN(X[[i]], ...) :
  Failed to infer source for package 'SparseM'; using latest available version on CRAN instead
7: In FUN(X[[i]], ...) :
  Failed to infer source for package 'ellipse'; using latest available version on CRAN instead
8: In FUN(X[[i]], ...) :
  Failed to infer source for package 'gcookbook'; using latest available version on CRAN instead
9: In FUN(X[[i]], ...) :
  Failed to infer source for package 'ggmcmc'; using latest available version on CRAN instead
10: In FUN(X[[i]], ...) :
  Failed to infer source for package 'makedummies'; using latest available version on CRAN instead
11: In FUN(X[[i]], ...) :
  Failed to infer source for package 'mcmc'; using latest available version on CRAN instead
12: In FUN(X[[i]], ...) :
  Failed to infer source for package 'msm'; using latest available version on CRAN instead
13: In FUN(X[[i]], ...) :
  Failed to infer source for package 'quantreg'; using latest available version on CRAN instead
14: In FUN(X[[i]], ...) :
  Failed to infer source for package 'reshape'; using latest available version on CRAN instead
15: In FUN(X[[i]], ...) :
  Failed to infer source for package 'vcd'; using latest available version on CRAN instead

Then, I updated all packages and tried to install the package "rethinking", but...

> install.packages("rethinking")
Warning in install.packages :
  package ‘rethinking’ is not available (for R version 3.5.3)

I am unsure what I should do next to resolve these problems. Thanks!

Johannes

cderv commented 5 years ago

The issue here is that your project depends on a package, rethinking, that you don't have installed apparently.

You either

JohannesTan commented 5 years ago

Thank you for your advice! I installed the package by following the github page you mentioned. I resolved the problem after that.

install.packages(c("coda","mvtnorm","devtools","loo"))
library(devtools)
devtools::install_github("rmcelreath/rethinking")

I learned, thanks to your comment, that this package is not on CRAN, so I could not install it with install.packages() function.

Johannes

leomarameo7 commented 4 years ago

Please, I have a conflict with "rethinking" and "packrat". I tried to initiate "packrat", with my existing project, but here's the error:

packrat::init() Initializing packrat project in directory:

"~/Desktop/functional_response_herbivore_fish" Error: Unable to retrieve package records for the following packages: 'rethinking' In addition: Warning messages: 1: In FUN(X[[i]], ...) : Package 'rethinking' not available in repository or locally 2: In FUN(X[[i]], ...) : Failed to infer source for package 'bdsmatrix'; using latest available version on CRAN instead

My hardware:

R version 3.6.3 (2020-02-29) -- "Holding the Windsock" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin15.6.0 (64-bit)