Rエラー
エラー解決
Warning in max(x) : no non-missing arguments to max; returning -Inf の原因と解決法
Warning in max(x) : no non-missing arguments to max; returning -Inf の原因と具体的な解決手順をまとめました。
エラーメッセージ(全文)
Warning in max(x) : no non-missing arguments to max; returning -Inf
このエラーとは
Warning in max(x) : no non-missing arguments to max; returning -Inf は R 開発でよく遭遇するエラーです。
想定環境: Windows / macOS / Linux
よく出る状況: R / 統計・データサイエンス演習
よくある原因
- パッケージ未インストール
- データ型不一致
- 列名 typo
- tidyverse 未読込
解決方法
方法1: install.packages
library() 前に install.packages('pkg').
方法2: str()/head()
データ構造を確認.
それでも直らないとき
バージョン情報(R のバージョン、OS、実行コマンド)を添えて、エラーメッセージ全文と直前に変更した点を確認してください。ログの数行上にも原因の手がかりが残っていることが多いです。
まとめ
「Warning in max(x) : no non-missing arguments to max; returning -Inf」は パッケージ未インストール が原因のことが多いです。上記の手順で切り分けてください。
次にやること
同じ R カテゴリの関連エラーもあわせて確認してください。
よくある質問
Warning in max(x) : no non-missing arguments to max; returning -Inf とは何ですか?
Warning in max(x) : no non-missing arguments to max; returning -Inf は R 実行時に表示されるエラーです。パッケージ未インストール
Warning in max(x) : no non-missing arguments to max; returning -Inf の原因は?
パッケージ未インストール。データ型不一致。列名 typo。
Warning in max(x) : no non-missing arguments to max; returning -Inf の直し方は?
install.packages:library() 前に install.packages('pkg'). str()/head():データ構造を確認.
R で Warning in max が出るのはなぜ?
R / 統計・データサイエンス演習
Warning in max(x) : no non-missing arguments to max; returning -Inf を防ぐには?
。
次に読むべき記事
- Error in solve.default(A, b) : system is computationally singular の原因と解決法
- Error in solve.default(A, b) : Lapack routine dgesv: system is exactly singular の原因と解決法
- Error in eigen(A) : 'x' must be a square numeric matrix の原因と解決法
- Error in renv::restore() : failed to retrieve package 'ggplot2' の原因と解決法
- Error: R CMD check failed の原因と解決法
同カテゴリ「Rエラー」の記事
- Error in setwd("C:/Users/student/project") : cannot change working directory の原因と解決法
- Quitting from lines 509-514 (report_509.Rmd) Error: object 'results' not found の原因と解決法
- Error in left_join(x, y, by = "id_507") : Join columns must be present in both datasets の原因と解決法
- Error in ggplot(data, aes(x = x506, y = y)) : could not find function "ggplot" の原因と解決法
- Quitting from lines 499-504 (report_499.Rmd) Error: object 'results' not found の原因と解決法
- Error in left_join(x, y, by = "id_497") : Join columns must be present in both datasets の原因と解決法
人気記事
- TS2307: Cannot find module '@components/Widget601' or its corresponding type declarations の原因と解決法
- TS2307: Cannot find module '@components/Widget591' or its corresponding type declarations の原因と解決法
- TS2307: Cannot find module '@components/Widget581' or its corresponding type declarations の原因と解決法
- TS2307: Cannot find module '@components/Widget571' or its corresponding type declarations の原因と解決法
- TS2307: Cannot find module '@components/Widget561' or its corresponding type declarations の原因と解決法
- TS2307: Cannot find module '@components/Widget551' or its corresponding type declarations の原因と解決法
学習ルート
体系的に学びたい方はこちらから。
エラー・トラブル集で続きを探す →あわせて読みたい
- Error in renv::restore() : failed to retrieve package 'ggplot2' の原因と解決法同カテゴリの関連エラー
- Error: R CMD check failed の原因と解決法同カテゴリの関連エラー
- Error in setRepositories() : invalid CRAN mirror の原因と解決法同カテゴリの関連エラー
- Error in RStudioGD() : Shadow graphics device error: rstudio unavailable の原因と解決法同カテゴリの関連エラー
- Error in grid.Call(C_textBounds, ...) : polygon edge not found の原因と解決法同カテゴリの関連エラー