0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Rのpsychパッケージのalpha関数でエラーが出るとき

Last updated at Posted at 2021-11-03

エラーメッセージの例

> alpha(set.data[,c(1,2,3)])
エラー: Unknown colour name: c(3, 4, 4, ..以下略

原因:psychの他にggplot2パッケージを読み込んでいると、psychではなくggplot2にあるalpha関数を呼び出してしまう。

対応1: ggplot2が以降のプログラムに必要ないときは、ggplo2をアンロードする。

detach("package:ggplot2", unload=TRUE)

対応2: ggplot2が処理に必要でアンロードできないときは、明示的にpsychパッケージのalpha関数を呼び出す。

psych::alpha(set.data[,c(1,2,3)])
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?