无法安装 Peaks 包:包“Peaks”不适用于此版本的 R

Unable to install Peaks package: package ‘Peaks’ is not available for this version of R

我正在处理系列数据,想计算每个系列中局部 'maxima' 和 'minima'(即峰值和 troughs/oscillations)的数量。我想为此使用 'Peaks' 包,但只收到以下错误:

WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

Warning in install.packages :
  package ‘Peaks’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages

按照建议我安装了 rtools 没有任何问题,但是当我尝试安装 'Peaks' 时它仍然返回相同的错误。我没有在 cran.r-project link 中找到任何信息,也尝试安装 findpeaks 但得到了同样的错误。我实际上不确定我的桌面上的 运行 是什么版本(您如何检查?);但我也在Rstudiocloud上试过,我认为这是最新版本(4.1.2)。我也试过:

findPeaks(MaxMn, thresh=0)
findValleys(MaxMn, thresh=0)

但是 R 找不到函数。我对它是一个包还是一个函数以及我需要做什么来实现它感到有点困惑。任何建议将不胜感激。

峰小插图:https://www.rdocumentation.org/packages/splus2R/versions/1.3-3/topics/peaks

安装 Rtools 后,您需要将其放在系统 PATH 中,以便 R 在尝试从其源代码构建包时可以找到它。在您的情况下,很可能安装了 Rtools 但不在系统路径上。

您可以从 Rtools 页面 (https://cran.r-project.org/bin/windows/Rtools/rtools40.html) 找到有关安装 rtools、添加到路径和验证安装正确的过程的最新详细信息。

is no longer available on CRAN:“已于 2019-04-18 存档,因为尽管有提醒,检查问题仍未得到纠正。”

通过谷歌搜索 "R detect peaks",您可能可以使用许多当前的软件包,包括 pracma 和 peakPick。除了 CRAN 之外,这也感觉像是 Bioconductor 存储库可能包含的包。