【问题标题】:Double Mass Curve双质量曲线
【发布时间】:2021-09-09 13:35:14
【问题描述】:

我正在尝试检查来自各个监测站的降雨数据趋势,并且我想使用双质量曲线功能,但是当我尝试安装 dmcurve 软件包时,我收到以下错误:

“dmcurve”包不可用(适用于 R 版本 3.6.2)。

【问题讨论】:

  • dmcurve 是一个名为 lfstat 的库中的函数。试试install.packages("lfstat")
  • 现在显示以下错误:库中的错误(dmcurve):没有名为“dmcurve”的包
  • library(lfstat) 那么你可以使用函数 dmcurve

标签: r error-handling trend


【解决方案1】:

我知道这是重复的,但评论过程似乎没有“工作”。所以这里是一个控制台屏幕截图,说明需要设置 dependencies=TRUE 并执行 library 调用以加载包:

> install.packages("lfstat", dependencies=TRUE)
also installing the dependency ‘lmomRFA’

trying URL 'https://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.6/lmomRFA_3.3.tgz'
Content type 'application/x-gzip' length 435665 bytes (425 KB)
==================================================
downloaded 425 KB

trying URL 'https://cloud.r-project.org/bin/macosx/el-capitan/contrib/3.6/lfstat_0.9.4.tgz'
Content type 'application/x-gzip' length 855964 bytes (835 KB)
==================================================
downloaded 835 KB


The downloaded binary packages are in
    /var/folders/68/vh2f8kzn09j8954r6q9100yh0000gn/T//RtmpvvgGGI/downloaded_packages
> ?dmcurve
No documentation for ‘dmcurve’ in specified packages and libraries:
you could try ‘??dmcurve’
#  The package was installed but not loaded
> library(lfstat)
Loading required package: xts
Loading required package: zoo

Attaching package: ‘zoo’

The following objects are masked from ‘package:base’:

    as.Date, as.Date.numeric

Loading required package: lmom
Loading required package: lattice
> ?dmcurve    # brings up help page

您看到我的软件包库没有 pkg​​:lmomRFA,但它已安装,因为 dependencies 参数设置为 TRUE。你也可以执行:

packageDescription("lfstat")
# which prints the package's DESCRIPTION file

Package: lfstat
Type: Package
Title: Calculation of Low Flow Statistics for Daily Stream Flow Data
Version: 0.9.4
### snipped several lines ###
Depends: R (>= 2.10), xts, lmom, lattice
Imports: lmomRFA, dygraphs, zoo, latticeExtra, plyr

显然我已经安装了大部分要求。也不是自动加载不在Depends: 列表中的包(pkg:zoo)。它是由“xts”包加载的二级依赖项。因此,如果您的库路径中还没有加载,您可能会在加载时遇到错误。

【讨论】:

    猜你喜欢
    • 2018-05-18
    • 1970-01-01
    • 2023-03-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多