LoginSignup
0
0

More than 5 years have passed since last update.

「‘XXX’ is not a valid installed package」のエラーが出た時の解決

Posted at

背景

  • 自作のRパッケージを作成し、RStudio Docker でそれをインストールしようと思い、あらかじめtar.gzに固めておいたものDocker build時にダウンロード、解凍、mvして指定のディレクトリ配下に設置した。
  • そのパッケージをlibrary(XXX)でロードしたら、タイトルのとおりエラーが出た。

原因

解決策

  • 原因は読んでもよくわからなかったが、コメントどおり実行したところ解決。無理やりパッケージのあるディレクトリにパッケージファイルを突っ込んだだけでは、だめってことは分かりました。
$ cd [パッケージがあるディレクトリ]
$ R CMD build XXX
* checking for file ‘XXX/DESCRIPTION’ ... OK
* preparing ‘XXX’:
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building ‘YYY.tar.gz’
$ R CMD INSTALL YYY.tar.gz
* installing to library ‘ZZZ’
* installing *source* package ‘XXX’ ...
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (XXX)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0